aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/jni/AppLibrary.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/jni/AppLibrary.cmake')
-rw-r--r--app/src/main/jni/AppLibrary.cmake26
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()