Skip to content

Commit 483a788

Browse files
committed
add docker/msvc-winsdk submodule, update build presets & dxc/CMakeLists.txt
1 parent 9bd76f9 commit 483a788

File tree

3 files changed

+22
-94
lines changed

3 files changed

+22
-94
lines changed

3rdparty/dxc/CMakeLists.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ list(APPEND NBL_DXC_CMAKE_OPTIONS "-DSPIRV_SKIP_EXECUTABLES:BOOL=ON")
4141
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DHLSL_ENABLE_DEBUG_ITERATORS:BOOL=ON")
4242
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DDXC_SPIRV_TOOLS_DIR=${DXC_SPIRV_TOOLS_DIR}")
4343
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DDXC_SPIRV_HEADERS_DIR=${DXC_SPIRV_HEADERS_DIR}")
44+
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DDXC_ENABLE_ETW=OFF")
4445

4546
if(NOT NBL_IS_MULTI_CONFIG)
4647
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
@@ -85,18 +86,23 @@ endif()
8586

8687
set(DXC_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/build" CACHE INTERNAL "")
8788

88-
if(MSVC AND (NOT "${CMAKE_GENERATOR}" STREQUAL "Ninja Multi-Config" AND NOT "${CMAKE_GENERATOR}" STREQUAL "Ninja"))
89-
execute_process(COMMAND "${CMAKE_COMMAND}" -C "${CMAKE_CURRENT_SOURCE_DIR}/dxc/cmake/caches/PredefinedParams.cmake" -S "${CMAKE_CURRENT_SOURCE_DIR}/dxc" -B "${DXC_BUILD_DIR}" -G "${CMAKE_GENERATOR}" "-Ax64" -T "${CMAKE_GENERATOR_TOOLSET}" ${NBL_DXC_CMAKE_OPTIONS}
90-
RESULT_VARIABLE DXC_CMAKE_RESULT
91-
OUTPUT_VARIABLE DXC_CMAKE_STREAM_PIPE
92-
)
93-
else()
94-
execute_process(COMMAND "${CMAKE_COMMAND}" -C "${CMAKE_CURRENT_SOURCE_DIR}/dxc/cmake/caches/PredefinedParams.cmake" -S "${CMAKE_CURRENT_SOURCE_DIR}/dxc" -B "${DXC_BUILD_DIR}" -G "${CMAKE_GENERATOR}" -T "${CMAKE_GENERATOR_TOOLSET}" ${NBL_DXC_CMAKE_OPTIONS}
95-
RESULT_VARIABLE DXC_CMAKE_RESULT
96-
OUTPUT_VARIABLE DXC_CMAKE_STREAM_PIPE
97-
)
89+
if(NOT CMAKE_GENERATOR MATCHES "Ninja*")
90+
list(APPEND NBL_DXC_CMAKE_OPTIONS -Ax64)
91+
endif()
92+
93+
if(CMAKE_GENERATOR_TOOLSET)
94+
list(APPEND NBL_DXC_CMAKE_OPTIONS -T "${CMAKE_GENERATOR_TOOLSET}")
9895
endif()
9996

97+
if(CMAKE_TOOLCHAIN_FILE)
98+
list(APPEND NBL_DXC_CMAKE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
99+
endif()
100+
101+
execute_process(COMMAND "${CMAKE_COMMAND}" -C "${CMAKE_CURRENT_SOURCE_DIR}/dxc/cmake/caches/PredefinedParams.cmake" -S "${CMAKE_CURRENT_SOURCE_DIR}/dxc" -B "${DXC_BUILD_DIR}" -G "${CMAKE_GENERATOR}" ${NBL_DXC_CMAKE_OPTIONS}
102+
RESULT_VARIABLE DXC_CMAKE_RESULT
103+
OUTPUT_VARIABLE DXC_CMAKE_STREAM_PIPE
104+
)
105+
100106
if(NOT "${DXC_CMAKE_RESULT}" STREQUAL "0")
101107
message(FATAL_ERROR "${DXC_CMAKE_STREAM_PIPE}")
102108
endif()

CMakePresets.json

Lines changed: 5 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"version": 6,
33
"cmakeMinimumRequired": {
44
"major": 3,
5-
"minor": 29,
6-
"patch": 2
5+
"minor": 31,
6+
"patch": 0
77
},
88
"configurePresets": [
99
{
@@ -90,37 +90,17 @@
9090
{
9191
"name": "ci-configure-static-msvc",
9292
"inherits": "ci-configure-static-windows-base",
93-
"displayName": "[CI]: Static library target, Visual Studio 17 2022 generator, MSVC v143 toolset",
94-
"description": "Configure as static library with Visual Studio 17 2022 generator and MSVC v143 toolset",
95-
"generator": "Visual Studio 17 2022",
96-
"toolset": "v143"
97-
},
98-
{
99-
"name": "ci-configure-dynamic-msvc",
100-
"inherits": "ci-configure-dynamic-windows-base",
101-
"displayName": "[CI]: Dynamic library target, Visual Studio 17 2022 generator, MSVC v143 toolset",
102-
"description": "Configure as dynamic library with Visual Studio 17 2022 generator and MSVC v143 toolset",
103-
"generator": "Visual Studio 17 2022",
104-
"toolset": "v143"
105-
},
106-
{
107-
"name": "ci-configure-static-ninja-multi",
108-
"inherits": "ci-configure-static-windows-base",
109-
"displayName": "[CI]: Static library target, Ninja multi-config generator",
110-
"description": "Configure as static library with Ninja multi-config generator",
11193
"generator": "Ninja Multi-Config",
11294
"cacheVariables": {
113-
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
95+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/docker/msvc-winsdk/cmake/winsdk-msvc-toolchain.cmake"
11496
}
11597
},
11698
{
117-
"name": "ci-configure-dynamic-ninja-multi",
99+
"name": "ci-configure-dynamic-msvc",
118100
"inherits": "ci-configure-dynamic-windows-base",
119-
"displayName": "[CI]: Dynamic library target, Ninja multi-config generator",
120-
"description": "Configure as dynamic library with Ninja multi-config generator",
121101
"generator": "Ninja Multi-Config",
122102
"cacheVariables": {
123-
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
103+
"CMAKE_TOOLCHAIN_FILE": "${sourceDir}/docker/msvc-winsdk/cmake/winsdk-msvc-toolchain.cmake"
124104
}
125105
},
126106
{
@@ -319,8 +299,6 @@
319299
"configurePreset": "ci-configure-static-msvc",
320300
"inheritConfigureEnvironment": true,
321301
"inherits": "build-windows-base",
322-
"displayName": "[CI]: Static library target, Visual Studio 17 2022 generator, MSVC v143 toolset",
323-
"description": "Build Nabla as static library with Visual Studio 17 2022 generator and MSVC v143 toolset",
324302
"condition": {
325303
"type": "equals",
326304
"lhs": "$env{NBL_CI_MODE}",
@@ -332,34 +310,6 @@
332310
"configurePreset": "ci-configure-dynamic-msvc",
333311
"inheritConfigureEnvironment": true,
334312
"inherits": "build-windows-base",
335-
"displayName": "[CI]: Dynamic library target, Visual Studio 17 2022 generator, MSVC v143 toolset",
336-
"description": "Build Nabla as dynamic library with Visual Studio 17 2022 generator and MSVC v143 toolset",
337-
"condition": {
338-
"type": "equals",
339-
"lhs": "$env{NBL_CI_MODE}",
340-
"rhs": "ON"
341-
}
342-
},
343-
{
344-
"name": "ci-build-static-ninja-multi",
345-
"configurePreset": "ci-configure-static-ninja-multi",
346-
"inheritConfigureEnvironment": true,
347-
"inherits": "build-windows-base",
348-
"displayName": "[CI]: Static library target, Ninja multi-config generator",
349-
"description": "Build Nabla as static library with Ninja multi-config generator",
350-
"condition": {
351-
"type": "equals",
352-
"lhs": "$env{NBL_CI_MODE}",
353-
"rhs": "ON"
354-
}
355-
},
356-
{
357-
"name": "ci-build-dynamic-ninja-multi",
358-
"configurePreset": "ci-configure-dynamic-ninja-multi",
359-
"inheritConfigureEnvironment": true,
360-
"inherits": "build-windows-base",
361-
"displayName": "[CI]: Dynamic library target, Ninja multi-config generator",
362-
"description": "Build Nabla as dynamic library with Ninja multi-config generator",
363313
"condition": {
364314
"type": "equals",
365315
"lhs": "$env{NBL_CI_MODE}",
@@ -466,8 +416,6 @@
466416
"name": "ci-package-static-msvc",
467417
"inherits": "ci-package-windows-base",
468418
"configurePreset": "ci-configure-static-msvc",
469-
"displayName": "[CI]: Static library target, Visual Studio 17 2022 generator, MSVC v143 toolset",
470-
"description": "Package Nabla as static library compiled with Visual Studio 17 2022 generator and MSVC v143 toolset",
471419
"condition": {
472420
"type": "equals",
473421
"lhs": "$env{NBL_CI_MODE}",
@@ -478,32 +426,6 @@
478426
"name": "ci-package-dynamic-msvc",
479427
"inherits": "ci-package-windows-base",
480428
"configurePreset": "ci-configure-dynamic-msvc",
481-
"displayName": "[CI]: Dynamic library target, Visual Studio 17 2022 generator, MSVC v143 toolset",
482-
"description": "Package Nabla as dynamic library compiled with Visual Studio 17 2022 generator and MSVC v143 toolset",
483-
"condition": {
484-
"type": "equals",
485-
"lhs": "$env{NBL_CI_MODE}",
486-
"rhs": "ON"
487-
}
488-
},
489-
{
490-
"name": "ci-package-static-ninja-multi",
491-
"inherits": "ci-package-windows-base",
492-
"configurePreset": "ci-configure-static-ninja-multi",
493-
"displayName": "[CI]: Static library target, Ninja multi-config generator",
494-
"description": "Package Nabla as static library compiled with Ninja multi-config generator",
495-
"condition": {
496-
"type": "equals",
497-
"lhs": "$env{NBL_CI_MODE}",
498-
"rhs": "ON"
499-
}
500-
},
501-
{
502-
"name": "ci-package-dynamic-ninja-multi",
503-
"inherits": "ci-package-windows-base",
504-
"configurePreset": "ci-configure-dynamic-ninja-multi",
505-
"displayName": "[CI]: Dynamic library target, Ninja multi-config generator",
506-
"description": "Package Nabla as dynamic library compiled with Ninja multi-config generator",
507429
"condition": {
508430
"type": "equals",
509431
"lhs": "$env{NBL_CI_MODE}",

docker/msvc-winsdk

0 commit comments

Comments
 (0)