Files
ndk-samples/cmake/AppLibrary.cmake
Dan Albert 36a3dc6811 Factor out common library flags to a function.
I assume I'll want to make more "global" changes at some point, so
rather than copying the same add_compile_options into every project,
create add_app_library() as a wrapper around add_library() which handles
the common stuff.
2025-09-04 14:15:42 +00:00

16 lines
354 B
CMake

include_guard()
# Wrapper for add_library which enables common options we want for all
# libraries.
function(add_app_library name)
cmake_parse_arguments(PARSE_ARGV 1 arg "" "" "")
add_library(${name} ${arg_UNPARSED_ARGUMENTS})
target_compile_options(${name}
PRIVATE
-Wall
-Wextra
-Werror
)
endfunction()