summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-07-18 13:12:35 +0800
committerGitHub <noreply@github.com>2024-07-18 13:12:35 +0800
commit494efd7254f28ec46aff84bb1c06fe582a743c1a (patch)
tree646ec4c4698ba508d04cb6b25d92d85ee242fc97 /cmake
parent3c092719a51fd954ead3c14561b0dcf4d6659695 (diff)
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
Diffstat (limited to 'cmake')
-rw-r--r--cmake/SlangTarget.cmake11
1 files changed, 9 insertions, 2 deletions
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