Skip to content

Commit 47e3e4c

Browse files
committed
update dxc submodule with adding clang library correction, add dxc to Nabla build system via subdirectory and find out that their BS isn't supposed to work being added with this method (wrong link/include paths, weird errors) - TODO: build it as external project
1 parent f9da966 commit 47e3e4c

File tree

4 files changed

+74
-2
lines changed

4 files changed

+74
-2
lines changed

3rdparty/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ set(BUILD_SHARED_LIBS ${_OLD_BUILD_SHARED_LIBS})
1616
set(BUILD_STATIC_LIBS ${_OLD_BUILD_STATIC_LIBS})
1717
set(BUILD_TESTING ${_OLD_BUILD_TESTING})
1818

19-
2019
# openssl
2120
add_subdirectory(openssl openssl EXCLUDE_FROM_ALL)
2221

22+
# DXC
23+
#option(_NBL_COMPILE_WITH_DXC_ "Build Nabla with DXC" ON)
24+
if(_NBL_COMPILE_WITH_DXC_)
25+
add_subdirectory(dxc dxc EXCLUDE_FROM_ALL)
26+
endif()
2327

2428
# volk
2529
set(VOLK_PULL_IN_VULKAN OFF CACHE INTERNAL "" FORCE) # Needed to make sure vulkan library will not be linked in examples

3rdparty/dxc/CMakeLists.txt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
set(HLSL_OPTIONAL_PROJS_IN_DEFAULT OFF CACHE BOOL "")
2+
set(HLSL_ENABLE_ANALYZE OFF CACHE BOOL "")
3+
set(HLSL_OFFICIAL_BUILD OFF CACHE BOOL "")
4+
set(HLSL_ENABLE_FIXED_VER OFF CACHE BOOL "")
5+
set(HLSL_FIXED_VERSION_LOCATION "" CACHE STRING "")
6+
set(HLSL_BUILD_DXILCONV ON CACHE BOOL "")
7+
set(CLANG_VENDOR "" CACHE STRING "")
8+
set(ENABLE_SPIRV_CODEGEN OFF CACHE BOOL "")
9+
set(SPIRV_BUILD_TESTS OFF CACHE BOOL "")
10+
set(CLANG_ENABLE_ARCMT OFF CACHE BOOL "")
11+
set(CLANG_ENABLE_STATIC_ANALYZER OFF CACHE BOOL "")
12+
set(CLANG_INCLUDE_TESTS OFF CACHE BOOL "")
13+
set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
14+
set(HLSL_INCLUDE_TESTS OFF CACHE BOOL "")
15+
set(LLVM_TARGETS_TO_BUILD None CACHE STRING "")
16+
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
17+
set(LLVM_INCLUDE_TESTS OFF CACHE BOOL "")
18+
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
19+
set(LIBCLANG_BUILD_STATIC ON CACHE BOOL "")
20+
set(LLVM_OPTIMIZED_TABLEGEN OFF CACHE BOOL "")
21+
set(LLVM_REQUIRES_EH ON CACHE BOOL "")
22+
set(LLVM_APPEND_VC_REV ON CACHE BOOL "")
23+
set(LLVM_ENABLE_RTTI ON CACHE BOOL "")
24+
set(LLVM_ENABLE_EH ON CACHE BOOL "")
25+
set(LLVM_DEFAULT_TARGET_TRIPLE dxil-ms-dx CACHE STRING "")
26+
set(CLANG_BUILD_EXAMPLES OFF CACHE BOOL "")
27+
set(LLVM_REQUIRES_RTTI ON CACHE BOOL "")
28+
set(CLANG_CL OFF CACHE BOOL "")
29+
set(DXC_BUILD_ARCH x64 CACHE INTERNAL "")
30+
#CMAKE_SYSTEM_VERSION=10.0.17763.0
31+
32+
add_subdirectory(dxc/ dxc/)
33+
34+
unset(HLSL_OPTIONAL_PROJS_IN_DEFAULT CACHE)
35+
unset(HLSL_ENABLE_ANALYZE CACHE)
36+
unset(HLSL_OFFICIAL_BUILD CACHE)
37+
unset(HLSL_ENABLE_FIXED_VER CACHE)
38+
unset(HLSL_FIXED_VERSION_LOCATION CACHE)
39+
unset(HLSL_BUILD_DXILCONV CACHE)
40+
unset(CLANG_VENDOR CACHE)
41+
unset(ENABLE_SPIRV_CODEGEN CACHE)
42+
unset(SPIRV_BUILD_TESTS CACHE)
43+
unset(CLANG_ENABLE_ARCMT CACHE)
44+
unset(CLANG_ENABLE_STATIC_ANALYZER CACHE)
45+
unset(CLANG_INCLUDE_TESTS CACHE)
46+
unset(LLVM_INCLUDE_TESTS CACHE)
47+
unset(HLSL_INCLUDE_TESTS CACHE)
48+
unset(LLVM_TARGETS_TO_BUILD CACHE)
49+
unset(LLVM_INCLUDE_DOCS CACHE)
50+
unset(LLVM_INCLUDE_TESTS CACHE)
51+
unset(LLVM_INCLUDE_EXAMPLES CACHE)
52+
unset(LIBCLANG_BUILD_STATIC CACHE)
53+
unset(LLVM_OPTIMIZED_TABLEGEN CACHE)
54+
unset(LLVM_REQUIRES_EH CACHE)
55+
unset(LLVM_APPEND_VC_REV CACHE)
56+
unset(LLVM_ENABLE_RTTI CACHE)
57+
unset(LLVM_ENABLE_EH CACHE)
58+
unset(LLVM_DEFAULT_TARGET_TRIPLE CACHE)
59+
unset(CLANG_BUILD_EXAMPLES CACHE)
60+
unset(LLVM_REQUIRES_RTTI CACHE)
61+
unset(CLANG_CL CACHE)
62+
unset(DXC_BUILD_ARCH CACHE)

src/nbl/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,12 @@ if(_NBL_COMPILE_WITH_GLI_)
575575
target_include_directories(Nabla PUBLIC ${THIRD_PARTY_SOURCE_DIR}/gli)
576576
endif()
577577

578+
# DXC
579+
if(_NBL_COMPILE_WITH_DXC_)
580+
add_dependencies(Nabla dxc dxcompiler)
581+
# TODO
582+
endif()
583+
578584
# Linux Display Systems
579585
if (UNIX AND NOT ANDROID AND NOT APPLE)
580586
target_include_directories(Nabla PUBLIC

0 commit comments

Comments
 (0)