Skip to content

Commit

Permalink
runtime/Cpp/runtime/CMakeLists.txt: Install PDB files as well
Browse files Browse the repository at this point in the history
We already generate them for e.g. RelWithDebInfo configurations.

Signed-off-by: Thomas Braun <[email protected]>
  • Loading branch information
t-b committed Nov 28, 2023
1 parent d25d421 commit 679269b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions runtime/Cpp/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,20 @@ if (ANTLR_BUILD_CPP_TESTS)
endif()
endif()

include(GNUInstallDirs)

if (TARGET antlr4_shared)
install(TARGETS antlr4_shared
EXPORT antlr4-targets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

if(MSVC)
install(FILES $<TARGET_PDB_FILE:antlr4_shared>
DESTINATION ${CMAKE_INSTALL_BINDIR}
OPTIONAL)
endif()
endif()

if (TARGET antlr4_static)
Expand All @@ -182,6 +190,12 @@ if (TARGET antlr4_static)
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})

if(MSVC)
install(FILES $<TARGET_FILE_DIR:antlr4_static>/$<TARGET_PROPERTY:antlr4_static,COMPILE_PDB_NAME>.pdb
DESTINATION ${CMAKE_INSTALL_LIBDIR}
OPTIONAL)
endif()
endif()

install(DIRECTORY "${PROJECT_SOURCE_DIR}/runtime/src/"
Expand Down

0 comments on commit 679269b

Please sign in to comment.