Skip to content

Commit

Permalink
cmake unified if() AND/OR at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Jul 22, 2024
1 parent ade98d5 commit 887d82b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions cmake/CommonModules/CsDebug.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ function(cs_print_target_properties target)
foreach(property ${CMAKE_PROPERTY_LIST})
string(REPLACE "<CONFIG>" "${cmakeBuildTypeUpper}" property ${property})

if(property STREQUAL "LOCATION" OR property MATCHES "^LOCATION_"
OR property MATCHES "_LOCATION$")
if(property STREQUAL "LOCATION" OR property MATCHES "^LOCATION_" OR
property MATCHES "_LOCATION$"
)
continue()
endif()

Expand Down
18 changes: 9 additions & 9 deletions cmake/TinyPackageConfigHelpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ function(tiny_build_type_requirements_install_tree

# Match Debug builds types for MSVC (linking debug against release
# (or vice-versa) cause crashes)
elseif(MSVC AND ((cmakeBuildTypeLower STREQUAL "debug"
AND NOT "debug" IN_LIST cvfTargetConfigurations)
OR (NOT cmakeBuildTypeLower STREQUAL "debug" AND cvfIsDebugOnly))
elseif(MSVC AND ((cmakeBuildTypeLower STREQUAL "debug" AND
NOT "debug" IN_LIST cvfTargetConfigurations) OR
(NOT cmakeBuildTypeLower STREQUAL "debug" AND cvfIsDebugOnly))
)
# Obtain target configurations in printable format
tiny_printable_configurations(tinyPrintableConfigurations
Expand Down Expand Up @@ -208,12 +208,12 @@ function(tiny_build_type_requirements_build_tree
# (or vice-versa) cause crashes)
# Or if matching equal build tree was enabled and builds types don't match then
# also tag as unsuitable (this is Build tree specific)
elseif((cvf_match_buildtree
AND NOT cmakeBuildTypeLower STREQUAL cvfConfigBuildTypeLower)
OR (MSVC AND ((cmakeBuildTypeLower STREQUAL "debug"
AND NOT cvfConfigBuildTypeLower STREQUAL "debug")
OR (NOT cmakeBuildTypeLower STREQUAL "debug"
AND cvfConfigBuildTypeLower STREQUAL "debug")))
elseif((cvf_match_buildtree AND
NOT cmakeBuildTypeLower STREQUAL cvfConfigBuildTypeLower) OR
(MSVC AND ((cmakeBuildTypeLower STREQUAL "debug" AND
NOT cvfConfigBuildTypeLower STREQUAL "debug") OR
(NOT cmakeBuildTypeLower STREQUAL "debug" AND
cvfConfigBuildTypeLower STREQUAL "debug")))
)
set(${out_package_version}
"${${out_package_version}} single-config CMAKE_BUILD_TYPE=${cvf_config_build_type}"
Expand Down

0 comments on commit 887d82b

Please sign in to comment.