From 5126d58ab2252357014df4136a4a1e07c7c2d5f4 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Tue, 15 Oct 2024 01:07:58 +0800 Subject: Fix release build failure (#5285) * Fix race condition for building stdlib headers Fixes https://github.com/shader-slang/slang/issues/5270 * Generalize slangtarget install options * Install slang-without-embedded-stdlib with generators --------- Co-authored-by: Yong He --- cmake/SlangTarget.cmake | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) (limited to 'cmake/SlangTarget.cmake') diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake index 9e3fe11cd..bf1abe3a9 100644 --- a/cmake/SlangTarget.cmake +++ b/cmake/SlangTarget.cmake @@ -390,35 +390,29 @@ function(slang_add_target dir type) # # Mark for installation # - if(ARG_INSTALL OR ARG_INSTALL_COMPONENT) - set(component_args) - if(ARG_INSTALL_COMPONENT) - set(component_args COMPONENT ${ARG_INSTALL_COMPONENT}) - endif() - set(exclude_arg) - if(NOT ARG_INSTALL) - set(exclude_arg EXCLUDE_FROM_ALL) - endif() + macro(i) install( TARGETS ${target} EXPORT SlangTargets ARCHIVE DESTINATION ${archive_subdir} - ${component_args} - ${exclude_arg} + ${ARGN} LIBRARY DESTINATION ${library_subdir} - ${component_args} - ${exclude_arg} + ${ARGN} RUNTIME DESTINATION ${runtime_subdir} - ${component_args} - ${exclude_arg} + ${ARGN} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ${component_args} - ${exclude_arg} + ${ARGN} ) + endmacro() + if(ARG_INSTALL) + i() + endif() + if(ARG_INSTALL_COMPONENT) + i(EXCLUDE_FROM_ALL COMPONENT ${ARG_INSTALL_COMPONENT}) endif() endfunction() -- cgit v1.2.3