mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-06 09:56:26 +00:00
cmake: optionally install pdb's
This commit is contained in:
19
.github/workflows/msvc.yml
vendored
19
.github/workflows/msvc.yml
vendored
@@ -36,13 +36,20 @@ jobs:
|
|||||||
srcdir = r"${{ github.workspace }}".replace("\\", "/")
|
srcdir = r"${{ github.workspace }}".replace("\\", "/")
|
||||||
builddir = f"{ srcdir }/build"
|
builddir = f"{ srcdir }/build"
|
||||||
os.makedirs(builddir)
|
os.makedirs(builddir)
|
||||||
|
cmakelists_txt = textwrap.dedent(f"""\
|
||||||
|
# Always build .PDB symbol file
|
||||||
|
set(CMAKE_POLICY_DEFAULT_CMP0141 "NEW" CACHE STRING "MSVC debug information format flags are selected by an abstraction")
|
||||||
|
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "ProgramDatabase" CACHE STRING "MSVC debug information format")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flags for executables")
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS "-DEBUG" CACHE STRING "Linker flag for shared libraries")
|
||||||
|
cmake_minimum_required(VERSION 3.0...3.25)
|
||||||
|
project(sdl_user)
|
||||||
|
enable_testing()
|
||||||
|
add_subdirectory("{ srcdir }" SDL)
|
||||||
|
""")
|
||||||
|
print(cmakelists_txt)
|
||||||
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
with open(f"{ builddir }/CMakeLists.txt", "w") as f:
|
||||||
f.write(textwrap.dedent(f"""\
|
f.write(cmakelists_txt)
|
||||||
cmake_minimum_required(VERSION 3.0...3.25)
|
|
||||||
project(sdl_user)
|
|
||||||
enable_testing()
|
|
||||||
add_subdirectory("{ srcdir }" SDL)
|
|
||||||
"""))
|
|
||||||
- name: Configure (CMake)
|
- name: Configure (CMake)
|
||||||
run: cmake -S build -B build `
|
run: cmake -S build -B build `
|
||||||
-Wdeprecated -Wdev -Werror `
|
-Wdeprecated -Wdev -Werror `
|
||||||
|
@@ -3264,6 +3264,9 @@ if(NOT SDL_DISABLE_INSTALL)
|
|||||||
FRAMEWORK DESTINATION "."
|
FRAMEWORK DESTINATION "."
|
||||||
RESOURCE DESTINATION "${SDL_SDL_INSTALL_RESOURCEDIR}"
|
RESOURCE DESTINATION "${SDL_SDL_INSTALL_RESOURCEDIR}"
|
||||||
)
|
)
|
||||||
|
if(MSVC)
|
||||||
|
install(FILES $<TARGET_PDB_FILE:SDL3-shared> DESTINATION "${CMAKE_INSTALL_BINDIR}" OPTIONAL)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(SDL_STATIC)
|
if(SDL_STATIC)
|
||||||
|
@@ -557,6 +557,11 @@ if(SDL_INSTALL_TESTS)
|
|||||||
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
|
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
if(MSVC)
|
||||||
|
foreach(test IN LISTS SDL_TEST_EXECUTABLES)
|
||||||
|
install(FILES $<TARGET_PDB_FILE:${test}> DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3" OPTIONAL)
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
install(
|
install(
|
||||||
FILES ${RESOURCE_FILES}
|
FILES ${RESOURCE_FILES}
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
|
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/installed-tests/SDL3
|
||||||
|
Reference in New Issue
Block a user