Skip to content

Commit 79dc7ef

Browse files
authored
Add SLANG_ENABLE_DXIL (shader-slang#5853)
1 parent 48ac6f2 commit 79dc7ef

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ option(
105105
ON
106106
)
107107

108+
option(SLANG_ENABLE_DXIL "Enable generating DXIL with DXC" ON)
109+
108110
option(SLANG_ENABLE_FULL_IR_VALIDATION "Enable full IR validation (SLOW!)")
109111
option(SLANG_ENABLE_IR_BREAK_ALLOC, "Enable _debugUID on IR allocation")
110112
option(SLANG_ENABLE_ASAN "Enable ASAN (address sanitizer)")

cmake/CompilerFlags.cmake

+8-17
Original file line numberDiff line numberDiff line change
@@ -198,23 +198,14 @@ function(set_default_compile_options target)
198198
# Settings dependent on config options
199199
#
200200

201-
if(SLANG_ENABLE_FULL_DEBUG_VALIDATION)
202-
target_compile_definitions(
203-
${target}
204-
PRIVATE SLANG_ENABLE_FULL_IR_VALIDATION
205-
)
206-
endif()
207-
208-
if(SLANG_ENABLE_IR_BREAK_ALLOC)
209-
target_compile_definitions(
210-
${target}
211-
PRIVATE SLANG_ENABLE_IR_BREAK_ALLOC
212-
)
213-
endif()
214-
215-
if(SLANG_ENABLE_DX_ON_VK)
216-
target_compile_definitions(${target} PRIVATE SLANG_CONFIG_DX_ON_VK)
217-
endif()
201+
target_compile_definitions(
202+
${target}
203+
PRIVATE
204+
SLANG_ENABLE_DXIL_SUPPORT=$<BOOL:${SLANG_ENABLE_DXIL}>
205+
$<$<BOOL:${SLANG_ENABLE_FULL_DEBUG_VALIDATION}>:SLANG_ENABLE_FULL_IR_VALIDATION>
206+
$<$<BOOL:${SLANG_ENABLE_IR_BREAK_ALLOC}>:SLANG_ENABLE_IR_BREAK_ALLOC>
207+
$<$<BOOL:${SLANG_ENABLE_DX_ON_VK}>:SLANG_CONFIG_DX_ON_VK>
208+
)
218209

219210
if(SLANG_ENABLE_ASAN)
220211
add_supported_cxx_flags(

docs/building.md

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ See the [documentation on testing](../tools/slang-test/README.md) for more infor
152152
| `SLANG_VERSION` | Latest `v*` tag | The project version, detected using git if available |
153153
| `SLANG_EMBED_CORE_MODULE` | `TRUE` | Build slang with an embedded version of the core module |
154154
| `SLANG_EMBED_CORE_MODULE_SOURCE` | `TRUE` | Embed the core module source in the binary |
155+
| `SLANG_ENABLE_DXIL` | `TRUE` | Enable generating DXIL using DXC |
155156
| `SLANG_ENABLE_ASAN` | `FALSE` | Enable ASAN (address sanitizer) |
156157
| `SLANG_ENABLE_FULL_IR_VALIDATION` | `FALSE` | Enable full IR validation (SLOW!) |
157158
| `SLANG_ENABLE_IR_BREAK_ALLOC` | `FALSE` | Enable IR BreakAlloc functionality for debugging. |

0 commit comments

Comments
 (0)