Skip to content

Commit

Permalink
Don't force /Zi when using CMAKE_MSVC_DEBUG_INFORMATION_FORMAT (#7041)
Browse files Browse the repository at this point in the history
Newer versions of CMake have a more robust way of handling debug
information settings for Windows. Forcing this on breaks the ability to
control how debug info is generated and gets in the way of using
sccache.

See CMake's docs:

https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_DEBUG_INFORMATION_FORMAT.html
  • Loading branch information
llvm-beanz authored Dec 18, 2024
1 parent 7786737 commit 6c2b9f3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,11 @@ if( MSVC )

# Change release to always build debug information out-of-line, but
# also enable Reference optimization, ie dead function elimination.
append("/Zi" CMAKE_CXX_FLAGS_RELEASE)
append("/DEBUG /OPT:REF" CMAKE_SHARED_LINKER_FLAGS_RELEASE)
append("/DEBUG /OPT:REF" CMAKE_EXE_LINKER_FLAGS_RELEASE)
if (NOT CMAKE_MSVC_DEBUG_INFORMATION_FORMAT)
append("/Zi" CMAKE_CXX_FLAGS_RELEASE)
append("/DEBUG /OPT:REF" CMAKE_SHARED_LINKER_FLAGS_RELEASE)
append("/DEBUG /OPT:REF" CMAKE_EXE_LINKER_FLAGS_RELEASE)
endif()

# HLSL Changes End

Expand Down

0 comments on commit 6c2b9f3

Please sign in to comment.