Build PDB for debugging on Windows (#2685)
* Build PDB for debugging on Windows * Update CMakeLists.txt
This commit is contained in:
parent
5c3aef03ea
commit
895f2f2e10
|
@ -825,6 +825,12 @@ if(CAPSTONE_BUILD_SHARED_LIBS)
|
|||
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
)
|
||||
target_compile_definitions(capstone PUBLIC CAPSTONE_SHARED)
|
||||
# Build pdb file for dll on Windows
|
||||
if(MSVC)
|
||||
message("Enabling PDB for Windows")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Fuzzer if this is moved to it's own CMakeLists.txt (as it should be)
|
||||
|
@ -951,6 +957,14 @@ if(CAPSTONE_INSTALL)
|
|||
DESTINATION ${CAPSTONE_CMAKE_CONFIG_INSTALL_DIR}
|
||||
)
|
||||
|
||||
if (MSVC AND CAPSTONE_BUILD_SHARED_LIBS)
|
||||
install(FILES
|
||||
$<TARGET_PDB_FILE:capstone_shared>
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
OPTIONAL
|
||||
)
|
||||
endif()
|
||||
|
||||
# uninstall target
|
||||
if(NOT TARGET UNINSTALL)
|
||||
configure_file(
|
||||
|
|
Loading…
Reference in New Issue