cmake: Add SECP256K1_LATE_CFLAGS configure option

This commit is contained in:
Hennadii Stepanov
2023-04-26 11:10:03 +01:00
parent 1f33bb2b1c
commit 42f8c51402
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
# Add compile options to all targets added in the subdirectory.
function(all_targets_compile_options dir options)
get_directory_property(targets DIRECTORY ${dir} BUILDSYSTEM_TARGETS)
separate_arguments(options)
set(compiled_target_types STATIC_LIBRARY SHARED_LIBRARY OBJECT_LIBRARY EXECUTABLE)
foreach(target ${targets})
get_target_property(type ${target} TYPE)
if(type IN_LIST compiled_target_types)
target_compile_options(${target} PRIVATE ${options})
endif()
endforeach()
endfunction()