Skip to content

Commit 39bb3e1

Browse files
committed
update dxc submodule with fixed clang 19.1.1 build, upgrade & correct NBL_REQUEST_COMPILE_OPTION_SUPPORT, add required instruction set features for simdjson explicitly; now I hit GLI errors due to bad templates
1 parent 062b5ba commit 39bb3e1

File tree

3 files changed

+38
-4
lines changed

3 files changed

+38
-4
lines changed

cmake/adjust/flags.cmake

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ define_property(TARGET PROPERTY NBL_CONFIGURATION_MAP
1515
# Usage: NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG <LANG;...> CONFIG <CONFIG;...> OPTIONS <OPTIONS;...> )
1616
# LANG, CONFIG - optional, OPTIONS - required
1717
function(NBL_REQUEST_COMPILE_OPTION_SUPPORT)
18-
cmake_parse_arguments(IMPL "" "" "LANG;CONFIG;OPTIONS" ${ARGN})
18+
cmake_parse_arguments(IMPL "" "REQUEST_VAR;REQUIRED" "LANG;CONFIG;OPTIONS" ${ARGN})
1919

2020
set(DEFAULT_COMPILERS c cxx)
21+
set(REQUEST_ALL_OPTIONS_PRESENT True)
2122

2223
if(NOT IMPL_LANG)
2324
list(APPEND IMPL_LANG ${DEFAULT_COMPILERS})
@@ -51,14 +52,33 @@ function(NBL_REQUEST_COMPILE_OPTION_SUPPORT)
5152
foreach(CONFIG ${IMPL_CONFIG})
5253
# TODO: validate (${CONFIG} \in ${CMAKE_CONFIGURATION_TYPES})
5354
string(TOUPPER "${CONFIG}" CONFIG_UPPER)
54-
set(NBL_${COMPILER_UPPER}_${CONFIG_UPPER}_COMPILE_OPTIONS "${NBL_${COMPILER_UPPER}_${CONFIG_UPPER}_COMPILE_OPTIONS};${COMPILE_OPTION}" PARENT_SCOPE)
55+
set(NBL_${COMPILER_UPPER}_${CONFIG_UPPER}_COMPILE_OPTIONS "${NBL_${COMPILER_UPPER}_${CONFIG_UPPER}_COMPILE_OPTIONS};${COMPILE_OPTION}")
5556
endforeach()
5657
else()
57-
set(NBL_${COMPILER_UPPER}_COMPILE_OPTIONS "${NBL_${COMPILER_UPPER}_COMPILE_OPTIONS};${COMPILE_OPTION}" PARENT_SCOPE)
58+
set(NBL_${COMPILER_UPPER}_COMPILE_OPTIONS "${NBL_${COMPILER_UPPER}_COMPILE_OPTIONS};${COMPILE_OPTION}")
5859
endif()
60+
else()
61+
if(IMPL_REQUIRED)
62+
message(FATAL_ERROR "Terminating, NBL_REQUEST_COMPILE_OPTION_SUPPORT was invoked with REQUIRED qualifier!")
63+
endif()
64+
65+
set(REQUEST_ALL_OPTIONS_PRESENT False)
5966
endif()
6067
endforeach()
68+
69+
if(IMPL_CONFIG)
70+
foreach(CONFIG ${IMPL_CONFIG})
71+
string(TOUPPER "${CONFIG}" CONFIG_UPPER)
72+
set(NBL_${COMPILER_UPPER}_${CONFIG_UPPER}_COMPILE_OPTIONS ${NBL_${COMPILER_UPPER}_${CONFIG_UPPER}_COMPILE_OPTIONS} PARENT_SCOPE)
73+
endforeach()
74+
else()
75+
set(NBL_${COMPILER_UPPER}_COMPILE_OPTIONS ${NBL_${COMPILER_UPPER}_COMPILE_OPTIONS} PARENT_SCOPE)
76+
endif()
6177
endforeach()
78+
79+
if(IMPL_REQUEST_VAR)
80+
set(${IMPL_REQUEST_VAR} ${REQUEST_ALL_OPTIONS_PRESENT} PARENT_SCOPE)
81+
endif()
6282
endfunction()
6383

6484
option(NBL_REQUEST_SSE_4_2 "Request compilation with SSE 4.2 instruction set enabled for Nabla projects" ON)

cmake/adjust/template/vendor/impl/Clang.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,20 @@ if(NBL_REQUEST_SSE_AVX2)
1818
)
1919
endif()
2020

21+
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} OPTIONS
22+
# latest Clang(CL) 19.1.1 shipped with VS seems to require explicitly features to be listed (simdjson)
23+
# TODO: Yas, use with REQUEST_VAR, if the request fail then do not promote simdjson to build with
24+
# HASWELL implementation because those flags + avx2 compose subset it wants in this case
25+
26+
# also instead of enabling single options maybe we could consider requesting an
27+
# instruction implementation set instead, eg -march=haswel, though this approach
28+
# could add a few more flags then we actually need while building - to rethink
29+
30+
-mbmi # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mbmi
31+
-mlzcnt # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mlzcnt
32+
-mpclmul # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mpclmul
33+
)
34+
2135
list(APPEND NBL_${LANG}_COMPILE_OPTIONS
2236
-Wextra # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-W-warning
2337
-maes # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-maes

0 commit comments

Comments
 (0)