diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-12-05 17:45:24 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-05 09:45:24 +0000 |
| commit | 072cb60bb63e9f3d1c42fa18adcebb77bb4aa6ae (patch) | |
| tree | f123367640c89e8d112009ccd6fb389a6a24ee92 /cmake | |
| parent | 3f4b3112871bb978ee5104fd36321345da35a8d1 (diff) | |
Remove duplicate call to install() for libslang (#5767)
Closes https://github.com/shader-slang/slang/issues/5764
Also mention other installed targets in cmake config
Diffstat (limited to 'cmake')
| -rw-r--r-- | cmake/LLVM.cmake | 1 | ||||
| -rw-r--r-- | cmake/SlangTarget.cmake | 23 |
2 files changed, 18 insertions, 6 deletions
diff --git a/cmake/LLVM.cmake b/cmake/LLVM.cmake index 3c7c1b543..a72cae0f5 100644 --- a/cmake/LLVM.cmake +++ b/cmake/LLVM.cmake @@ -88,6 +88,7 @@ function(fetch_or_build_slang_llvm) EXPORT_MACRO_PREFIX SLANG INSTALL INSTALL_COMPONENT slang-llvm + EXPORT_SET_NAME SlangTargets ) # If we don't include this, then the symbols in the LLVM linked here may # conflict with those of other LLVMs linked at runtime, for instance in mesa. diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake index 17b017361..4da2cab3b 100644 --- a/cmake/SlangTarget.cmake +++ b/cmake/SlangTarget.cmake @@ -53,6 +53,8 @@ function(slang_add_target dir type) # explicit name instead, used for externally built things such as # slang-glslang and slang-llvm which have large pdb files DEBUG_INFO_INSTALL_COMPONENT + # The name of the Export set to associate with this installed target + EXPORT_SET_NAME ) set(multi_value_args # Use exactly these sources, instead of globbing from the directory @@ -408,22 +410,31 @@ function(slang_add_target dir type) # Mark for installation # macro(i) + if(ARG_EXPORT_SET_NAME) + set(export_args EXPORT ${ARG_EXPORT_SET_NAME}) + else() + if(type MATCHES "^(EXECUTABLE|SHARED|MODULE)$") + message( + WARNING + "Target ${target} is set to be INSTALLED but EXPORT_SET_NAME wasn't specified" + ) + endif() + set(export_args) + endif() install( - TARGETS ${target} - EXPORT SlangTargets + TARGETS ${target} ${export_args} ARCHIVE DESTINATION ${archive_subdir} ${ARGN} LIBRARY DESTINATION ${library_subdir} ${ARGN} RUNTIME DESTINATION ${runtime_subdir} ${ARGN} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ${ARGN} ) 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") + elseif(ARG_INSTALL) + i() + set(pdb_component "debug-info") endif() if(ARG_DEBUG_INFO_INSTALL_COMPONENT) set(pdb_component ${ARG_DEBUG_INFO_INSTALL_COMPONENT}) |
