|
| 1 | +# Daemon BSD Source Code |
| 2 | +# Copyright (c) 2025, Daemon Developers |
| 3 | +# All rights reserved. |
| 4 | +# |
| 5 | +# Redistribution and use in source and binary forms, with or without |
| 6 | +# modification, are permitted provided that the following conditions are met: |
| 7 | +# * Redistributions of source code must retain the above copyright |
| 8 | +# notice, this list of conditions and the following disclaimer. |
| 9 | +# * Redistributions in binary form must reproduce the above copyright |
| 10 | +# notice, this list of conditions and the following disclaimer in the |
| 11 | +# documentation and/or other materials provided with the distribution. |
| 12 | +# * Neither the name of the <organization> nor the |
| 13 | +# names of its contributors may be used to endorse or promote products |
| 14 | +# derived from this software without specific prior written permission. |
| 15 | +# |
| 16 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| 17 | +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 18 | +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 19 | +# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY |
| 20 | +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 21 | +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 22 | +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 23 | +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 24 | +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 25 | +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 26 | + |
| 27 | +# Work around https://github.com/DaemonEngine/Daemon/issues/398. The Visual Studio CMake |
| 28 | +# integration, which uses a (single-config) Ninja generator, sets the configuration name |
| 29 | +# to an arbitrary name instead of "Release", "Debug" etc. So then $<CONFIG:Debug> etc. |
| 30 | +# doesn't work since it doesn't correspond to CMAKE_BUILD_TYPE. |
| 31 | +get_property(are_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) |
| 32 | +if (are_multi_config) |
| 33 | + set(DEBUG_GENEXP_COND "$<CONFIG:Debug>") |
| 34 | + set(MINSIZEREL_GENEXP_COND "$<CONFIG:MinSizeRel>") |
| 35 | + set(RELWITHDEBINFO_GENEXP_COND "$<CONFIG:RelWithDebInfo>") |
| 36 | + set(RELEASE_GENEXP_COND "$<CONFIG:Release>") |
| 37 | +else() |
| 38 | + set(DEBUG_GENEXP_COND "0") |
| 39 | + set(MINSIZEREL_GENEXP_COND "0") |
| 40 | + set(RELWITHDEBINFO_GENEXP_COND "0") |
| 41 | + set(RELEASE_GENEXP_COND "0") |
| 42 | + string(TOUPPER ${CMAKE_BUILD_TYPE} build_type_upper) |
| 43 | + set(${build_type_upper}_GENEXP_COND "1") |
| 44 | +endif() |
0 commit comments