Skip to content

Commit

Permalink
Install PDB files when available
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 committed Nov 25, 2024
1 parent e30f053 commit 76519c4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"generators": ["ZIP"],
"variables": {
"CPACK_PACKAGE_FILE_NAME": "slang",
"CPACK_COMPONENTS_ALL": "Unspecified;metadata;slang-llvm"
"CPACK_COMPONENTS_ALL": "Unspecified;metadata;debug-info;slang-llvm"
}
},
{
Expand Down
26 changes: 26 additions & 0 deletions cmake/SlangTarget.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ function(slang_add_target dir type)
DEBUG_DIR
# Install this target as part of a component
INSTALL_COMPONENT
# Don't install debug info by default for this target and use this
# explicit name instead, used for externally built things such as
# slang-glslang and slang-llvm which have large pdb files
DEBUG_INFO_INSTALL_COMPONENT
)
set(multi_value_args
# Use exactly these sources, instead of globbing from the directory
Expand Down Expand Up @@ -408,9 +412,31 @@ function(slang_add_target dir type)
endmacro()
if(ARG_INSTALL)
i()
set(pdb_component "debug-info")
endif()
if(ARG_INSTALL_COMPONENT)
i(EXCLUDE_FROM_ALL COMPONENT ${ARG_INSTALL_COMPONENT})
set(pdb_component "${ARG_INSTALL_COMPONENT}-debug-info")
endif()
if(ARG_DEBUG_INFO_INSTALL_COMPONENT)
set(pdb_component ${ARG_DEBUG_INFO_INSTALL_COMPONENT})
endif()
if(MSVC AND DEFINED pdb_component)
if(
type STREQUAL "EXECUTABLE"
OR type STREQUAL "SHARED"
OR type STREQUAL "MODULE"
)
install(
FILES $<TARGET_PDB_FILE:${target}>
DESTINATION ${runtime_subdir}
# Optional, because if we're building without debug info (like
# a release build) then we don't want to fail here.
OPTIONAL
COMPONENT ${pdb_component}
EXCLUDE_FROM_ALL
)
endif()
endif()
endfunction()

Expand Down
Empty file modified docs/user-guide/a3-02-reference-capability-atoms.md
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions source/slang-glslang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if(SLANG_ENABLE_SLANG_GLSLANG)
LINK_WITH_PRIVATE glslang SPIRV SPIRV-Tools-opt
INCLUDE_DIRECTORIES_PRIVATE ${slang_SOURCE_DIR}/include
INSTALL
DEBUG_INFO_INSTALL_COMPONENT slang-glslang-debug-info
)
# Our only interface is through what we define in source/slang-glslang, in the
# interests of hygiene, hide anything else we link in.
Expand Down

0 comments on commit 76519c4

Please sign in to comment.