Skip to content

Commit

Permalink
Merge #250: cmake: Fix quoting for string arguments
Browse files Browse the repository at this point in the history
f4dd154 cmake: Fix quoting for string arguments (Hennadii Stepanov)

Pull request description:

  A string argument must be quoted, Otherwise, if a string is empty, the called function will fail to get it.

  The modified code does not cause any wrong behaviour on the staging branch @ a7cc7d8. But that can be a problem if commits are reordered (when preparing a pull request for the main repository).

ACKs for top commit:
  TheCharlatan:
    lgtm ACK f4dd154

Tree-SHA512: 795844b3337ff4a07b76ff1d58d524a7b0a245c0eec53b0bb2258e8d4993dfa35e2e0cd6641c32dcc05839239a7beae28c66871276c1c4593bef597ee4d59792
  • Loading branch information
hebasto committed Jul 1, 2024
2 parents 9794bdd + f4dd154 commit 1eb1250
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cmake/module/FlagsSummary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ function(print_flags_per_config config indent_num)
string(TOUPPER "${config}" config_uppercase)

include(GetTargetInterface)
get_target_interface(definitions ${config} core_interface COMPILE_DEFINITIONS)
get_target_interface(definitions "${config}" core_interface COMPILE_DEFINITIONS)
indent_message("Preprocessor defined macros ..........." "${definitions}" ${indent_num})

string(STRIP "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_cxx_flags)
string(STRIP "${combined_cxx_flags} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}" combined_cxx_flags)
if(CMAKE_POSITION_INDEPENDENT_CODE)
string(JOIN " " combined_cxx_flags ${combined_cxx_flags} ${CMAKE_CXX_COMPILE_OPTIONS_PIC})
endif()
get_target_interface(core_cxx_flags ${config} core_interface COMPILE_OPTIONS)
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)
string(STRIP "${combined_linker_flags} ${CMAKE_EXE_LINKER_FLAGS}" combined_linker_flags)
get_target_interface(common_link_options ${config} core_interface LINK_OPTIONS)
get_target_interface(common_link_options "${config}" core_interface LINK_OPTIONS)
string(STRIP "${combined_linker_flags} ${common_link_options}" combined_linker_flags)
if(CMAKE_CXX_LINK_PIE_SUPPORTED)
string(JOIN " " combined_linker_flags ${combined_linker_flags} ${CMAKE_CXX_LINK_OPTIONS_PIE})
Expand All @@ -58,11 +58,11 @@ function(flags_summary)
foreach(config IN LISTS CMAKE_CONFIGURATION_TYPES)
message("")
message("'${config}' build configuration:")
print_flags_per_config(${config} 2)
print_flags_per_config("${config}" 2)
endforeach()
else()
message("CMAKE_BUILD_TYPE ...................... ${CMAKE_BUILD_TYPE}")
print_flags_per_config(${CMAKE_BUILD_TYPE} 0)
print_flags_per_config("${CMAKE_BUILD_TYPE}" 0)
endif()
message("")
message([=[
Expand Down

0 comments on commit 1eb1250

Please sign in to comment.