diff options
author | Đoàn Trần Công Danh <congdanhqx@gmail.com> | 2021-04-01 13:14:06 (GMT) |
---|---|---|
committer | Đoàn Trần Công Danh <congdanhqx@gmail.com> | 2021-04-02 01:07:46 (GMT) |
commit | ce1cadd35a26bd44879675581d8e70b00ff8e0fc (patch) | |
tree | 3c87bb21690350fbcada1a0ab476367022c8ab9a /Tests/ConfigSources | |
parent | a8d2f7f459b861bee52990db9c1ed9f603dc6ef9 (diff) | |
download | CMake-ce1cadd35a26bd44879675581d8e70b00ff8e0fc.zip CMake-ce1cadd35a26bd44879675581d8e70b00ff8e0fc.tar.gz CMake-ce1cadd35a26bd44879675581d8e70b00ff8e0fc.tar.bz2 |
Tests/ConfigSources: fix for non main stream CMAKE_BUILD_TYPE
- None is a valid CMAKE_BUILD_TYPE
- Most of distros uses None as CMAKE_BUILD_TYPE
- When CMAKE_BUILD_TYPE=None, main_other.cpp will be compiled and linked
into final executable, this program requires some symbols only exist
when CUSTOM_CFG_OTHER is defined.
- And CMake also allows other CMAKE_BUILD_TYPE, too, CMake documentation
specificaly mentions funny CMAKE_BUILD_TYPE like ReLeAsE [1]
Let's define them when non main stream like None is specified as CMAKE_BUILD_TYPE.
[1]: https://cmake.org/cmake/help/v3.20/variable/CMAKE_BUILD_TYPE.html
Diffstat (limited to 'Tests/ConfigSources')
-rw-r--r-- | Tests/ConfigSources/CMakeLists.txt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt index a3d98f6..f83759c 100644 --- a/Tests/ConfigSources/CMakeLists.txt +++ b/Tests/ConfigSources/CMakeLists.txt @@ -74,10 +74,10 @@ add_custom_command(APPEND VERBATIM ) foreach(n RANGE 1 5) - set_property(SOURCE custom${n}_Debug.cpp PROPERTY COMPILE_DEFINITIONS CUSTOM_CFG_DEBUG) - foreach(other Release RelWithDebInfo MinSizeRel) + foreach(other ${CMAKE_BUILD_TYPE} Release RelWithDebInfo MinSizeRel) set_property(SOURCE custom${n}_${other}.cpp PROPERTY COMPILE_DEFINITIONS CUSTOM_CFG_OTHER) endforeach() + set_property(SOURCE custom${n}_Debug.cpp PROPERTY COMPILE_DEFINITIONS CUSTOM_CFG_DEBUG) endforeach() add_library(Custom STATIC custom1_$<CONFIG>.cpp |