Skip to content

Commit 9f3e0ef

Browse files
authored
Merge branch 'master' into conform-integer-literals
2 parents 5be2f08 + 6c655ca commit 9f3e0ef

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

CMakePresets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"generators": ["ZIP"],
120120
"variables": {
121121
"CPACK_PACKAGE_FILE_NAME": "slang",
122-
"CPACK_COMPONENTS_ALL": "Unspecified;metadata;slang-llvm"
122+
"CPACK_COMPONENTS_ALL": "Unspecified;metadata;debug-info;slang-llvm"
123123
}
124124
},
125125
{

cmake/SlangTarget.cmake

+26
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ function(slang_add_target dir type)
4949
DEBUG_DIR
5050
# Install this target as part of a component
5151
INSTALL_COMPONENT
52+
# Don't install debug info by default for this target and use this
53+
# explicit name instead, used for externally built things such as
54+
# slang-glslang and slang-llvm which have large pdb files
55+
DEBUG_INFO_INSTALL_COMPONENT
5256
)
5357
set(multi_value_args
5458
# Use exactly these sources, instead of globbing from the directory
@@ -415,9 +419,31 @@ function(slang_add_target dir type)
415419
endmacro()
416420
if(ARG_INSTALL)
417421
i()
422+
set(pdb_component "debug-info")
418423
endif()
419424
if(ARG_INSTALL_COMPONENT)
420425
i(EXCLUDE_FROM_ALL COMPONENT ${ARG_INSTALL_COMPONENT})
426+
set(pdb_component "${ARG_INSTALL_COMPONENT}-debug-info")
427+
endif()
428+
if(ARG_DEBUG_INFO_INSTALL_COMPONENT)
429+
set(pdb_component ${ARG_DEBUG_INFO_INSTALL_COMPONENT})
430+
endif()
431+
if(MSVC AND DEFINED pdb_component)
432+
if(
433+
type STREQUAL "EXECUTABLE"
434+
OR type STREQUAL "SHARED"
435+
OR type STREQUAL "MODULE"
436+
)
437+
install(
438+
FILES $<TARGET_PDB_FILE:${target}>
439+
DESTINATION ${runtime_subdir}
440+
# Optional, because if we're building without debug info (like
441+
# a release build) then we don't want to fail here.
442+
OPTIONAL
443+
COMPONENT ${pdb_component}
444+
EXCLUDE_FROM_ALL
445+
)
446+
endif()
421447
endif()
422448
endfunction()
423449

include/slang.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,8 @@ typedef uint32_t SlangSizeT;
823823
enum SlangDebugInfoFormat : SlangDebugInfoFormatIntegral
824824
{
825825
SLANG_DEBUG_INFO_FORMAT_DEFAULT, ///< Use the default debugging format for the target
826-
SLANG_DEBUG_INFO_FORMAT_C7, ///< CodeView C7 format (typically means debugging information is
827-
///< embedded in the binary)
826+
SLANG_DEBUG_INFO_FORMAT_C7, ///< CodeView C7 format (typically means debugging information
827+
///< is embedded in the binary)
828828
SLANG_DEBUG_INFO_FORMAT_PDB, ///< Program database
829829

830830
SLANG_DEBUG_INFO_FORMAT_STABS, ///< Stabs

source/slang-glslang/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ if(SLANG_ENABLE_SLANG_GLSLANG)
99
LINK_WITH_PRIVATE glslang SPIRV SPIRV-Tools-opt
1010
INCLUDE_DIRECTORIES_PRIVATE ${slang_SOURCE_DIR}/include
1111
INSTALL
12+
DEBUG_INFO_INSTALL_COMPONENT slang-glslang-debug-info
1213
)
1314
# Our only interface is through what we define in source/slang-glslang, in the
1415
# interests of hygiene, hide anything else we link in.

0 commit comments

Comments
 (0)