Skip to content

Commit

Permalink
[CMake] Enable new policy for CMAKE_MSVC_DEBUG_INFORMATION_FORMAT (ll…
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams authored Mar 12, 2024
1 parent 19266ca commit 23ffb2b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cmake/Modules/CMakePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,16 @@ endif()
if(POLICY CMP0116)
cmake_policy(SET CMP0116 OLD)
endif()

# MSVC debug information format flags are selected via
# CMAKE_MSVC_DEBUG_INFORMATION_FORMAT, instead of
# embedding flags in e.g. CMAKE_CXX_FLAGS_RELEASE.
# New in CMake 3.25.
#
# Supports debug info with SCCache
# (https://github.com/mozilla/sccache?tab=readme-ov-file#usage)
# avoiding “fatal error C1041: cannot open program database; if
# multiple CL.EXE write to the same .PDB file, please use /FS"
+if(POLICY CMP0141)
+ cmake_policy(SET CMP0141 NEW)
+endif()

0 comments on commit 23ffb2b

Please sign in to comment.