summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-12-13 00:34:38 +0800
committerGitHub <noreply@github.com>2024-12-13 00:34:38 +0800
commit79dc7ef6992c761ad3bbb4d8a19f4d515d7b3d78 (patch)
tree15db2cae036df26346708e76ac31df0fb8593daa
parent48ac6f25ff53290850a0edff0285dc3e1a350ad3 (diff)
Add SLANG_ENABLE_DXIL (#5853)
-rw-r--r--CMakeLists.txt2
-rw-r--r--cmake/CompilerFlags.cmake25
-rw-r--r--docs/building.md1
3 files changed, 11 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b6f68b427..d9e44b058 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,6 +105,8 @@ option(
ON
)
+option(SLANG_ENABLE_DXIL "Enable generating DXIL with DXC" ON)
+
option(SLANG_ENABLE_FULL_IR_VALIDATION "Enable full IR validation (SLOW!)")
option(SLANG_ENABLE_IR_BREAK_ALLOC, "Enable _debugUID on IR allocation")
option(SLANG_ENABLE_ASAN "Enable ASAN (address sanitizer)")
diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake
index 6ba4cf0d7..b35f98b98 100644
--- a/cmake/CompilerFlags.cmake
+++ b/cmake/CompilerFlags.cmake
@@ -198,23 +198,14 @@ function(set_default_compile_options target)
# Settings dependent on config options
#
- if(SLANG_ENABLE_FULL_DEBUG_VALIDATION)
- target_compile_definitions(
- ${target}
- PRIVATE SLANG_ENABLE_FULL_IR_VALIDATION
- )
- endif()
-
- if(SLANG_ENABLE_IR_BREAK_ALLOC)
- target_compile_definitions(
- ${target}
- PRIVATE SLANG_ENABLE_IR_BREAK_ALLOC
- )
- endif()
-
- if(SLANG_ENABLE_DX_ON_VK)
- target_compile_definitions(${target} PRIVATE SLANG_CONFIG_DX_ON_VK)
- endif()
+ target_compile_definitions(
+ ${target}
+ PRIVATE
+ SLANG_ENABLE_DXIL_SUPPORT=$<BOOL:${SLANG_ENABLE_DXIL}>
+ $<$<BOOL:${SLANG_ENABLE_FULL_DEBUG_VALIDATION}>:SLANG_ENABLE_FULL_IR_VALIDATION>
+ $<$<BOOL:${SLANG_ENABLE_IR_BREAK_ALLOC}>:SLANG_ENABLE_IR_BREAK_ALLOC>
+ $<$<BOOL:${SLANG_ENABLE_DX_ON_VK}>:SLANG_CONFIG_DX_ON_VK>
+ )
if(SLANG_ENABLE_ASAN)
add_supported_cxx_flags(
diff --git a/docs/building.md b/docs/building.md
index f3b7e9d29..6af47979f 100644
--- a/docs/building.md
+++ b/docs/building.md
@@ -152,6 +152,7 @@ See the [documentation on testing](../tools/slang-test/README.md) for more infor
| `SLANG_VERSION` | Latest `v*` tag | The project version, detected using git if available |
| `SLANG_EMBED_CORE_MODULE` | `TRUE` | Build slang with an embedded version of the core module |
| `SLANG_EMBED_CORE_MODULE_SOURCE` | `TRUE` | Embed the core module source in the binary |
+| `SLANG_ENABLE_DXIL` | `TRUE` | Enable generating DXIL using DXC |
| `SLANG_ENABLE_ASAN` | `FALSE` | Enable ASAN (address sanitizer) |
| `SLANG_ENABLE_FULL_IR_VALIDATION` | `FALSE` | Enable full IR validation (SLOW!) |
| `SLANG_ENABLE_IR_BREAK_ALLOC` | `FALSE` | Enable IR BreakAlloc functionality for debugging. |