mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-18 15:17:13 +00:00
cmake: also install pdb files of static libraries
This commit is contained in:
parent
509c70c698
commit
adc0880520
|
@ -3510,8 +3510,8 @@ if(NOT SDL2_DISABLE_INSTALL)
|
||||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
if(MSVC AND NOT CMAKE_VERSION VERSION_LESS "3.1")
|
if(MSVC)
|
||||||
install(FILES $<TARGET_PDB_FILE:SDL2> DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
|
SDL_install_pdb(SDL2 "${CMAKE_INSTALL_BINDIR}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -3520,6 +3520,9 @@ if(NOT SDL2_DISABLE_INSTALL)
|
||||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
if(MSVC)
|
||||||
|
SDL_install_pdb(SDL2main "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_STATIC)
|
if(SDL_STATIC)
|
||||||
|
@ -3527,6 +3530,9 @@ if(NOT SDL2_DISABLE_INSTALL)
|
||||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
if(MSVC)
|
||||||
|
SDL_install_pdb(SDL2-static "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_TEST)
|
if(SDL_TEST)
|
||||||
|
@ -3534,6 +3540,9 @@ if(NOT SDL2_DISABLE_INSTALL)
|
||||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||||
|
if(MSVC)
|
||||||
|
SDL_install_pdb(SDL2_test "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
##### Export files #####
|
##### Export files #####
|
||||||
|
|
|
@ -124,3 +124,23 @@ if(CMAKE_VERSION VERSION_LESS 3.13.0)
|
||||||
link_directories(${ARGN})
|
link_directories(${ARGN})
|
||||||
endmacro()
|
endmacro()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# CMP0087: install(CODE) and install(SCRIPT) support generator expressions.
|
||||||
|
cmake_policy(SET CMP0087 NEW)
|
||||||
|
function(SDL_install_pdb TARGET DIRECTORY)
|
||||||
|
get_property(type TARGET ${TARGET} PROPERTY TYPE)
|
||||||
|
if(type MATCHES "^(SHARED_LIBRARY|EXECUTABLE)$")
|
||||||
|
if(NOT CMAKE_VERSION VERSION_LESS 3.1)
|
||||||
|
install(FILES $<TARGET_PDB_FILE:${TARGET}> DESTINATION "${DIRECTORY}" OPTIONAL)
|
||||||
|
endif()
|
||||||
|
elseif(type STREQUAL "STATIC_LIBRARY")
|
||||||
|
if(NOT CMAKE_VERSION VERSION_LESS 3.15)
|
||||||
|
# FIXME: Use $<TARGET_COMPILE_PDB_FILE:${TARGET} once it becomes available (https://gitlab.kitware.com/cmake/cmake/-/issues/25244)
|
||||||
|
if(CMAKE_GENERATOR MATCHES "^Visual Studio.*")
|
||||||
|
install(CODE "file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${DIRECTORY}\" TYPE FILE OPTIONAL FILES \"${CMAKE_CURRENT_BINARY_DIR}/\${CMAKE_INSTALL_CONFIG_NAME}/${TARGET}.pdb\")")
|
||||||
|
else()
|
||||||
|
install(CODE "file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${DIRECTORY}\" TYPE FILE OPTIONAL FILES \"${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${TARGET}.dir/${TARGET}.pdb\")")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
|
@ -481,7 +481,7 @@ if(SDL_INSTALL_TESTS)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
foreach(test ${SDL_TEST_EXECUTABLES})
|
foreach(test ${SDL_TEST_EXECUTABLES})
|
||||||
install(FILES $<TARGET_PDB_FILE:${test}> DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2" OPTIONAL)
|
SDL_install_pdb(${test} "${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL2")
|
||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
install(
|
install(
|
||||||
|
|
Loading…
Reference in a new issue