Skip to content

[CMake] Enable new policy for CMAKE_MSVC_DEBUG_INFORMATION_FORMAT #82371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, here, an extra + char had slipped in at the start of each line, breaking every single buildbot we have. But I pushed a fix in 1b945e3.

+ cmake_policy(SET CMP0141 NEW)
+endif()