1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

CMake: Make juce_recommended_config_flags CMP0141 aware

This commit is contained in:
reuk 2025-02-06 13:45:09 +00:00 committed by Oliver James
parent 58dcf68c53
commit 2dc933fd41

View file

@ -120,7 +120,22 @@ add_library(juce::juce_recommended_config_flags ALIAS juce_recommended_config_fl
if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
_juce_get_debug_config_genex(debug_config)
target_compile_options(juce_recommended_config_flags INTERFACE
$<IF:${debug_config},/Od /Zi,/Ox> $<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","MSVC">:/MP> /EHsc)
$<IF:${debug_config},/Od,/Ox> $<$<STREQUAL:"${CMAKE_CXX_COMPILER_ID}","MSVC">:/MP> /EHsc)
set(needs_debug_flag TRUE)
if(POLICY CMP0141)
set(policy_state)
cmake_policy(GET CMP0141 policy_state)
if("${policy_state}" STREQUAL "NEW")
set(needs_debug_flag FALSE)
endif()
endif()
if(needs_debug_flag)
target_compile_options(juce_recommended_config_flags INTERFACE $<${debug_config}:/Zi>)
endif()
elseif((CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))