Skip to content

Commit 23ffb2b

Browse files
authored
[CMake] Enable new policy for CMAKE_MSVC_DEBUG_INFORMATION_FORMAT (#82371)
1 parent 19266ca commit 23ffb2b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cmake/Modules/CMakePolicy.cmake

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,16 @@ endif()
1010
if(POLICY CMP0116)
1111
cmake_policy(SET CMP0116 OLD)
1212
endif()
13+
14+
# MSVC debug information format flags are selected via
15+
# CMAKE_MSVC_DEBUG_INFORMATION_FORMAT, instead of
16+
# embedding flags in e.g. CMAKE_CXX_FLAGS_RELEASE.
17+
# New in CMake 3.25.
18+
#
19+
# Supports debug info with SCCache
20+
# (https://github.com/mozilla/sccache?tab=readme-ov-file#usage)
21+
# avoiding “fatal error C1041: cannot open program database; if
22+
# multiple CL.EXE write to the same .PDB file, please use /FS"
23+
+if(POLICY CMP0141)
24+
+ cmake_policy(SET CMP0141 NEW)
25+
+endif()

0 commit comments

Comments
 (0)