aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorDave Abrahams <dabrahams@adobe.com>2024-03-12 03:30:43 -0700
committerGitHub <noreply@github.com>2024-03-12 12:30:43 +0200
commit23ffb2bdb96cf5a8eebce86b1ab21acf88979661 (patch)
tree9f5a05b23dd96cb95111b7b5b96929c968e97079 /cmake
parent19266ca389e3fc3bce9d24c074b836d6e69873ce (diff)
downloadllvm-23ffb2bdb96cf5a8eebce86b1ab21acf88979661.zip
llvm-23ffb2bdb96cf5a8eebce86b1ab21acf88979661.tar.gz
llvm-23ffb2bdb96cf5a8eebce86b1ab21acf88979661.tar.bz2
[CMake] Enable new policy for CMAKE_MSVC_DEBUG_INFORMATION_FORMAT (#82371)
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/CMakePolicy.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/Modules/CMakePolicy.cmake b/cmake/Modules/CMakePolicy.cmake
index 0ec32ad..b5bd1e6 100644
--- a/cmake/Modules/CMakePolicy.cmake
+++ b/cmake/Modules/CMakePolicy.cmake
@@ -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()