cmake: Add APPEND_{CPP,C,CXX,LD}FLAGS cache variables

The content of those variables is appended to the each target after the
flags added by the build system.
This commit is contained in:
Hennadii Stepanov committed 2024-08-16 21:19:11 +01:00
1 parent 2b43c45b13
commit 1f60b30df0
3 files changed
+30

No files matched your search

+3
View File
@@ -29,6 +29,8 @@ function(print_flags_per_config config indent_num)
endif()
get_target_interface(core_cxx_flags "${config}" core_interface COMPILE_OPTIONS)
string(STRIP "${combined_cxx_flags} ${core_cxx_flags}" combined_cxx_flags)
string(STRIP "${combined_cxx_flags} ${APPEND_CPPFLAGS}" combined_cxx_flags)
string(STRIP "${combined_cxx_flags} ${APPEND_CXXFLAGS}" combined_cxx_flags)
indent_message("C++ compiler flags ...................." "${combined_cxx_flags}" ${indent_num})
string(STRIP "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_linker_flags)
@@ -38,6 +40,7 @@ function(print_flags_per_config config indent_num)
if(CMAKE_CXX_LINK_PIE_SUPPORTED)
string(JOIN " " combined_linker_flags ${combined_linker_flags} ${CMAKE_CXX_LINK_OPTIONS_PIE})
endif()
string(STRIP "${combined_linker_flags} ${APPEND_LDFLAGS}" combined_linker_flags)
indent_message("Linker flags .........................." "${combined_linker_flags}" ${indent_num})
endfunction()