1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

CMake (MSVC): Make Zi default debug info flag

This restores the original debug-flag for CMake builds on Windows.
This commit is contained in:
Oliver James 2025-06-18 11:47:41 +01:00
parent 20b6a2c290
commit 4a79bc5cfd
2 changed files with 32 additions and 1 deletions

View file

@ -2,6 +2,37 @@
# develop
## Change
The "Debug Information Format" flag has been changed to "/Zi" from "/Z7" when
building JUCE on Windows using CMake.
**Possible Issues**
Some CI tooling (e.g., sscache) may experience issues writing debug information.
Debug information will no longer be stored inside the object files during the
build process.
**Workaround**
You can override the "Debug Information Format" flag with the
"CMAKE_MSVC_DEBUG_INFORMATION_FORMAT" which is available under policy "CMP0141".
This can be enabled at configuration time:
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded (for "/Z7")
or
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=ProgramDatabase (for "/Zi")
**Rationale**
The previous change to "/Z7" for the "Debug Information Format" flag caused
build artefacts to drastically increase in size in some configurations, which
could lead to build failures. In particular, when link-time code-generation is
enabled, .obj files generated with the debug info mode set to "Z7" or "None"
may be much larger than when using "Zi" instead.
## Change
The AudioFormat class now only has one virtual createWriterFor member function:

View file

@ -134,7 +134,7 @@ if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIA
endif()
if(needs_debug_flag)
target_compile_options(juce_recommended_config_flags INTERFACE $<${debug_config}:/Z7>)
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")