@@ -9,15 +9,32 @@ endif()
9
9
if (NBL_REQUEST_SSE_4_2)
10
10
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} OPTIONS
11
11
-msse4.2 # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang1-msse4.2
12
- )
12
+ REQUIRED) # TODO: (****) optional but then adjust 3rdparty options on fail
13
13
endif ()
14
14
15
15
if (NBL_REQUEST_SSE_AVX2)
16
16
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} OPTIONS
17
17
-mavx2 # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mavx2
18
- )
18
+ REQUIRED) # TODO: (**** )
19
19
endif ()
20
20
21
+ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} OPTIONS
22
+ -Xclang=-fconstexpr-backtrace-limit=696969
23
+ -Xclang=-fconstexpr-depth=696969
24
+ -Xclang=-fconstexpr-steps=696969
25
+ -Xclang=-ftemplate-backtrace-limit=0 # no limit
26
+ -Xclang=-ftemplate-depth=696969
27
+ -Xclang=-fmacro-backtrace-limit=0 # no limit
28
+ -Xclang=-fspell-checking-limit=0 # no limit
29
+ -Xclang=-fcaret-diagnostics-max-lines=0 # no limit
30
+
31
+ # whenever clang frontend or backend crashes we put diagnostics into top build direcotry
32
+ # use it to make a repro and attach to an issue - it outputs preprocessed cpp files with
33
+ # sh script for compilation
34
+ -fcrash-diagnostics=compiler
35
+ "-fcrash-diagnostics-dir=${NBL_ROOT_PATH_BINARY} /.crash-report"
36
+ REQUIRED)
37
+
21
38
NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} OPTIONS
22
39
# latest Clang(CL) 19.1.1 shipped with VS seems to require explicitly features to be listed (simdjson)
23
40
# TODO: Yas, use with REQUEST_VAR, if the request fail then do not promote simdjson to build with
@@ -27,12 +44,13 @@ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} OPTIONS
27
44
# instruction implementation set instead, eg -march=haswel, though this approach
28
45
# could add a few more flags then we actually need while building - to rethink
29
46
47
+ ################
48
+ # TODO: (****) ->
30
49
-mbmi # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mbmi
31
50
-mlzcnt # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mlzcnt
32
51
-mpclmul # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mpclmul
33
- )
52
+ ################ <-
34
53
35
- list (APPEND NBL_${LANG} _COMPILE_OPTIONS
36
54
-Wextra # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-W-warning
37
55
-maes # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-maes
38
56
-mfpmath=sse # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mfpmath
@@ -53,37 +71,34 @@ list(APPEND NBL_${LANG}_COMPILE_OPTIONS
53
71
-Wno-error=unused-parameter
54
72
-Wno-error=ignored-attributes
55
73
-Wno-error=non-pod-varargs
56
- )
74
+ REQUIRED )
57
75
58
76
if (NBL_SANITIZE_ADDRESS)
59
- list ( APPEND NBL_ ${LANG} _COMPILE_OPTIONS -fsanitize=address)
77
+ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} OPTIONS -fsanitize=address REQUIRED )
60
78
endif ()
61
79
62
80
if (NBL_SANITIZE_THREAD)
63
- list ( APPEND NBL_ ${LANG} _COMPILE_OPTIONS -fsanitize=thread)
81
+ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} OPTIONS -fsanitize=thread)
64
82
endif ()
65
83
66
- set (NBL_ ${LANG} _DEBUG_COMPILE_OPTIONS
84
+ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG DEBUG OPTIONS
67
85
-g # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-g
68
86
-mincremental-linker-compatible # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mincremental-linker-compatible
69
- -fincremental-extensions # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fincremental-extensions
87
+ -Xclang=- fincremental-extensions # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fincremental-extensions
70
88
-Wall # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-W-warning
71
- -fstack-protector-strong # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fstack-protector-strong
72
89
-gline-tables-only # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-gline-tables-only
73
- -fno-omit-frame-pointer # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fomit-frame-pointer
74
- -fno-inline-functions # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-finline-functions
75
- )
90
+ -Xclang=-fno-inline-functions # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-finline-functions
91
+ REQUIRED)
76
92
77
- set (NBL_ ${LANG} _RELEASE_COMPILE_OPTIONS
93
+ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG RELEASE OPTIONS
78
94
-O2 # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-O-arg
79
- -finline-functions # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-finline-functions
95
+ -Xclang=- finline-functions # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-finline-functions
80
96
-mno-incremental-linker-compatible # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mincremental-linker-compatible
81
- )
97
+ REQUIRED )
82
98
83
- set (NBL_ ${LANG} _RELWITHDEBINFO_COMPILE_OPTIONS
99
+ NBL_REQUEST_COMPILE_OPTION_SUPPORT(LANG ${LANG} CONFIG RELWITHDEBINFO OPTIONS
84
100
-g # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-g
85
101
-O1 # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-O-arg
86
- -finline-functions # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-finline-functions
102
+ -Xclang=- finline-functions # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-finline-functions
87
103
-mno-incremental-linker-compatible # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-mincremental-linker-compatible
88
- -fno-omit-frame-pointer # https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fomit-frame-pointer
89
- )
104
+ REQUIRED)
0 commit comments