Skip to content

Commit

Permalink
Generate and install PDBs for DLL and Proxy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 7, 2024
1 parent 0088b2e commit 6e71988
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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("$<$<NOT:$<CONFIG:DEBUG>>:/Zi;/Gy;/Oi>")

# /OPT:ICF enable COMDAT folding
# /DEBUG:FULL generate debug info (PDB)
# /OPT:REF enable references (PDB)
add_link_options("$<$<NOT:$<CONFIG:DEBUG>>:/OPT:ICF;/DEBUG:FULL;/OPT:REF>")
endif()

if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(ARCH_POSTFIX _x86)
else()
Expand Down
3 changes: 3 additions & 0 deletions src/usvfs_dll/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 $<TARGET_PDB_FILE:usvfs_dll> DESTINATION lib OPTIONAL)
install(EXPORT usvfs${ARCH_POSTFIX}Targets
FILE usvfs${ARCH_POSTFIX}Targets.cmake
NAMESPACE usvfs${ARCH_POSTFIX}::
Expand Down
1 change: 1 addition & 0 deletions src/usvfs_proxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ set_target_properties(usvfs_proxy
)

install(TARGETS usvfs_proxy EXPORT usvfs${ARCH_POSTFIX}Targets)
install(FILES $<TARGET_PDB_FILE:usvfs_proxy> DESTINATION lib OPTIONAL)

0 comments on commit 6e71988

Please sign in to comment.