diff options
| author | Arslaan Pathan <[email protected]> | 2026-08-16 16:43:55 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-08-16 16:43:55 +1200 |
| commit | cca2765ee64df3247f32ca0d7eb07ed5a7ad868a (patch) | |
| tree | 425f573573b4958261454006bc8a62a4dec8634a /app/src/main/jni/AppLibrary.cmake | |
| parent | d5e06f6dc6c39b750f0e01dc695a4ff7837ade67 (diff) | |
| download | moku-assistant-cca2765ee64df3247f32ca0d7eb07ed5a7ad868a.tar.xz moku-assistant-cca2765ee64df3247f32ca0d7eb07ed5a7ad868a.zip | |
[chore/migrate-cmake] replace Android.mk with CMake
Diffstat (limited to 'app/src/main/jni/AppLibrary.cmake')
| -rw-r--r-- | app/src/main/jni/AppLibrary.cmake | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/app/src/main/jni/AppLibrary.cmake b/app/src/main/jni/AppLibrary.cmake new file mode 100644 index 0000000..042dfcf --- /dev/null +++ b/app/src/main/jni/AppLibrary.cmake @@ -0,0 +1,26 @@ +include_guard() + +function(add_app_library name) + cmake_parse_arguments(PARSE_ARGV 1 arg "NO_VERSION_SCRIPT" "" "") + add_library(${name} ${arg_UNPARSED_ARGUMENTS}) + + target_compile_options(${name} + PRIVATE + -Wall + -Wextra + -Werror + ) + + if(NOT arg_NO_VERSION_SCRIPT) + target_link_options(${name} + PRIVATE + -Wl,--no-undefined-version + -Wl,--version-script,${CMAKE_SOURCE_DIR}/lib${name}.map.txt + ) + + set_target_properties(${name} + PROPERTIES + LINK_DEPENDS ${CMAKE_SOURCE_DIR}/lib${name}.map.txt + ) + endif() +endfunction() |
