-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native App Glue requires a C compiler #1906
Comments
What do you have in mind? This looks like the expected CMake behavior to me. You need to enable C support to build the C code. |
Providing a CMakeLists.txt in the project(ANDROID_NATIVE_APP_GLUE LANGUAGES C)
add_library(android_native_app_glue STATIC)
add_library(Android::NativeAppGlue ALIAS android_native_app_glue)
target_include_directories(android_native_app_glue PUBLIC .)
target_sources(android_native_app_glue PRIVATE
android_native_app_glue.c
android_native_app_glue.h
) Then I could just call add_subdirectory and link against the static library. add_subdirectory(${CMAKE_ANDROID_NDK}/sources/android/native_app_glue)
target_link_libraries(foobar PRIVATE Android::NativeAppGlue) Thoughts? |
Seems plausible. It might actually be more idiomatic to do something |
In case others see this thread. I'd advise using an object library. See this PR: https://github.com/KhronosGroup/Vulkan-ValidationLayers/pull/6343/files
This fixed an issue with our symbol exporting logic allowing us to use a version-script. |
Description
Our project only enables the CXX compiler by default.
However, for the Android build we have some awkward CMake code:
As you can see we need to enable a C compiler in order to use native app glue. This CMake isn't ideal and is confusing to look at unless you know what is going on. Ideally this process would be more streamlined.
Thoughts?
The text was updated successfully, but these errors were encountered: