From 494efd7254f28ec46aff84bb1c06fe582a743c1a Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Thu, 18 Jul 2024 13:12:35 +0800 Subject: Reduce duplication in slang lib builds (#4651) * spelling * Reduce duplication in slang lib builds Closes (as much as possible) https://github.com/shader-slang/slang/issues/4615 The only case where we could actually make a difference would be an embedded stdlib and static slang, which isn't a configuration anyone actually uses. Nonetheless, clean up this bit --- cmake/SlangTarget.cmake | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cmake/SlangTarget.cmake') diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake index c9110a6c0..e370a4987 100644 --- a/cmake/SlangTarget.cmake +++ b/cmake/SlangTarget.cmake @@ -49,9 +49,10 @@ function(slang_add_target dir type) EXPLICIT_SOURCE # Additional directories from which to glob source EXTRA_SOURCE_DIRS - # Additional compile definitions + # Additional compile definitions and options EXTRA_COMPILE_DEFINITIONS_PRIVATE EXTRA_COMPILE_DEFINITIONS_PUBLIC + EXTRA_COMPILE_OPTIONS_PRIVATE # Targets with which to link privately LINK_WITH_PRIVATE # Frameworks with which to link privately @@ -288,7 +289,7 @@ function(slang_add_target dir type) endforeach() # - # Other preprocessor defines + # Other preprocessor defines and options # if(ARG_EXTRA_COMPILE_DEFINITIONS_PRIVATE) target_compile_definitions( @@ -302,6 +303,12 @@ function(slang_add_target dir type) PUBLIC ${ARG_EXTRA_COMPILE_DEFINITIONS_PUBLIC} ) endif() + if(ARG_EXTRA_COMPILE_OPTIONS_PRIVATE) + target_compile_options( + ${target} + PRIVATE ${ARG_EXTRA_COMPILE_OPTIONS_PRIVATE} + ) + endif() # # Since we do a lot of dynamic loading, unconditionally set the build rpath -- cgit v1.2.3