vcpkg/ports/sese/001-msvc-pdbs.patch
2024-10-07 15:04:57 -04:00

26 lines
1.2 KiB
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 641e9d4ef..51d151149 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -48,6 +48,11 @@ if (EXISTS ${PROJECT_SOURCE_DIR}/.git)
get_git_branch(SESE_REPO_BRANCH ${CMAKE_CURRENT_LIST_DIR})
endif ()
+# for vcpkg_copy_pdbs()
+if (MSVC AND BUILD_SHARED_LIBS)
+ set(${CMAKE_CXX_FLAGS} "${CMAKE_CXX_FLAGS} /Zi")
+endif ()
+
if (NOT "${CMAKE_BUILD_TYPE}" MATCHES "Debug")
if (MSVC)
set(${CMAKE_CXX_FLAGS} "${CMAKE_CXX_FLAGS} /Ox")
@@ -62,7 +67,7 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Re
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3")
# for sanitizer
# 0xC0000135 : https://stackoverflow.com/questions/66531482/application-crashes-when-using-address-sanitizer-with-msvc
- # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address /fno-sanitize-address-vcasan-lib /Zi /D_DISABLE_VECTOR_ANNOTATION /D_DISABLE_STRING_ANNOTATION")
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fsanitize=address /fno-sanitize-address-vcasan-lib /D_DISABLE_VECTOR_ANNOTATION /D_DISABLE_STRING_ANNOTATION")
else ()
# unittest coverage
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-update=atomic")