Skip to content

Commit fd2ff27

Browse files
jpnurmiclaude
andcommitted
fix: Set CMAKE_MSVC_DEBUG_INFORMATION_FORMAT to Embedded for Windows
With CMP0141 NEW (added in sentry-native 0.13.5 for sccache support), CMAKE_MSVC_DEBUG_INFORMATION_FORMAT takes precedence over /Z7 in the compiler flags, defaulting to /Zi (external PDB). This causes LNK4099 warnings for consumers linking sentry-native.lib without the PDB. See https://cmake.org/cmake/help/latest/policy/CMP0141.html Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent ee49a58 commit fd2ff27

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
# Include debug info in the static library itself. See https://github.com/getsentry/sentry-native/issues/895 for context.
22
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/Z7 /O2 /Ob1 /DNDEBUG" CACHE STRING "C Flags for RelWithDebInfo" FORCE)
3-
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z7 /O2 /Ob1 /DNDEBUG" CACHE STRING "CXX Flags for RelWithDebInfo" FORCE)
3+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z7 /O2 /Ob1 /DNDEBUG" CACHE STRING "CXX Flags for RelWithDebInfo" FORCE)
4+
# With CMP0141 NEW (CMake 3.25+), CMAKE_MSVC_DEBUG_INFORMATION_FORMAT takes
5+
# precedence over /Z7 in the flags above. Set it explicitly to ensure debug
6+
# info is embedded (/Z7) rather than stored in an external PDB (/Zi).
7+
# See https://cmake.org/cmake/help/latest/policy/CMP0141.html
8+
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "Embedded" CACHE STRING "Debug info format" FORCE)

0 commit comments

Comments
 (0)