From 6e71988884f52a867e7b68cd1a5521ae6c4f1ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sun, 7 Jul 2024 12:12:22 +0200 Subject: [PATCH] Generate and install PDBs for DLL and Proxy. --- CMakeLists.txt | 12 ++++++++++++ src/usvfs_dll/CMakeLists.txt | 3 +++ src/usvfs_proxy/CMakeLists.txt | 1 + 3 files changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d9fc38..7288f8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,18 @@ set(CMAKE_CXX_STANDARD 20) set(USVFS_BINDIR ${CMAKE_CURRENT_LIST_DIR}/bin) set(USVFS_LIBDIR ${CMAKE_CURRENT_LIST_DIR}/lib) +if (MSVC) + # /Zi generate PDBs + # /Gy enable function-level linking + # /Oi enable intrinsic function + add_compile_options("$<$>:/Zi;/Gy;/Oi>") + + # /OPT:ICF enable COMDAT folding + # /DEBUG:FULL generate debug info (PDB) + # /OPT:REF enable references (PDB) + add_link_options("$<$>:/OPT:ICF;/DEBUG:FULL;/OPT:REF>") +endif() + if(CMAKE_SIZEOF_VOID_P EQUAL 4) set(ARCH_POSTFIX _x86) else() diff --git a/src/usvfs_dll/CMakeLists.txt b/src/usvfs_dll/CMakeLists.txt index 624874f..c5fdef0 100644 --- a/src/usvfs_dll/CMakeLists.txt +++ b/src/usvfs_dll/CMakeLists.txt @@ -42,11 +42,14 @@ set_target_properties(usvfs_dll LIBRARY_OUTPUT_NAME usvfs${ARCH_POSTFIX} LIBRARY_OUTPUT_DIRECTORY_DEBUG ${USVFS_LIBDIR} LIBRARY_OUTPUT_DIRECTORY_RELEASE ${USVFS_LIBDIR} + PDB_OUTPUT_DIRECTORY_DEBUG ${USVFS_LIBDIR} + PDB_OUTPUT_DIRECTORY_RELEASE ${USVFS_LIBDIR} RUNTIME_OUTPUT_NAME usvfs${ARCH_POSTFIX} RUNTIME_OUTPUT_DIRECTORY_DEBUG ${USVFS_LIBDIR} RUNTIME_OUTPUT_DIRECTORY_RELEASE ${USVFS_LIBDIR}) install(TARGETS usvfs_dll EXPORT usvfs${ARCH_POSTFIX}Targets FILE_SET HEADERS) +install(FILES $ DESTINATION lib OPTIONAL) install(EXPORT usvfs${ARCH_POSTFIX}Targets FILE usvfs${ARCH_POSTFIX}Targets.cmake NAMESPACE usvfs${ARCH_POSTFIX}:: diff --git a/src/usvfs_proxy/CMakeLists.txt b/src/usvfs_proxy/CMakeLists.txt index ffa9058..b67d913 100644 --- a/src/usvfs_proxy/CMakeLists.txt +++ b/src/usvfs_proxy/CMakeLists.txt @@ -12,3 +12,4 @@ set_target_properties(usvfs_proxy ) install(TARGETS usvfs_proxy EXPORT usvfs${ARCH_POSTFIX}Targets) +install(FILES $ DESTINATION lib OPTIONAL)