@@ -24,18 +24,18 @@ set(CMAKE_CXX_STANDARD 17)
24
24
set (CMAKE_CXX_STANDARD_REQUIRED YES )
25
25
26
26
# Build Options
27
- option (UR_DEVELOPER_MODE "enable developer checks, treats warnings as errors" OFF )
28
27
option (UR_BUILD_TESTS "Build unit tests." ON )
28
+ option (UR_BUILD_TOOLS "build ur tools" ON )
29
29
option (UR_FORMAT_CPP_STYLE "format code style of C++ sources" OFF )
30
+ option (UR_DEVELOPER_MODE "enable developer checks, treats warnings as errors" OFF )
30
31
option (UR_USE_ASAN "enable AddressSanitizer" OFF )
31
32
option (UR_USE_UBSAN "enable UndefinedBehaviorSanitizer" OFF )
32
33
option (UR_USE_MSAN "enable MemorySanitizer" OFF )
33
34
option (UR_USE_TSAN "enable ThreadSanitizer" OFF )
34
- option (UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF )
35
35
option (UR_ENABLE_TRACING "enable api tracing through xpti" OFF )
36
- option (VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace for linux" OFF )
37
- option (UR_BUILD_TOOLS "build ur tools" ON )
36
+ option (UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF )
38
37
option (UMF_ENABLE_POOL_TRACKING "Build UMF with pool tracking" OFF )
38
+ option (VAL_USE_LIBBACKTRACE_BACKTRACE "enable libbacktrace validation backtrace for linux" OFF )
39
39
40
40
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib )
41
41
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /lib )
@@ -130,11 +130,6 @@ if(UR_USE_MSAN)
130
130
add_sanitizer_flag (memory )
131
131
endif ()
132
132
133
- # Allow custom third_party folder
134
- if (NOT DEFINED THIRD_PARTY_DIR )
135
- set (THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party )
136
- endif ()
137
-
138
133
find_program (CLANG_FORMAT NAMES clang-format-15 clang-format-15.0 clang-format )
139
134
140
135
set (CLANG_FORMAT_REQUIRED "15.0" )
@@ -155,7 +150,7 @@ if(UR_FORMAT_CPP_STYLE)
155
150
endif ()
156
151
endif ()
157
152
158
- # Obtain files for clang-format
153
+ # Obtain files for clang-format and license check
159
154
set (format_glob )
160
155
set (license_glob )
161
156
foreach (dir examples include source test tools )
@@ -180,7 +175,7 @@ endforeach()
180
175
file (GLOB_RECURSE format_src ${format_glob} )
181
176
file (GLOB_RECURSE license_src ${license_glob} )
182
177
183
- # check for licence
178
+ # Add license check target
184
179
list (FILTER license_src EXCLUDE REGEX "registry.yml" )
185
180
add_custom_target (verify-licenses
186
181
COMMAND ${Python3_EXECUTABLE}
@@ -191,9 +186,13 @@ add_custom_target(verify-licenses
191
186
192
187
# Add code formatter target
193
188
add_custom_target (cppformat )
189
+ # ... and all source files to the formatter
190
+ add_cppformat (all -sources ${format_src} )
194
191
195
- # Add files to the formatter
196
- add_cppformat (src-formatter ${format_src} )
192
+ # Allow custom third_party folder
193
+ if (NOT DEFINED THIRD_PARTY_DIR )
194
+ set (THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR} /third_party )
195
+ endif ()
197
196
198
197
add_subdirectory (${THIRD_PARTY_DIR} )
199
198
@@ -273,5 +272,5 @@ if(UR_FORMAT_CPP_STYLE)
273
272
DEPENDS generate
274
273
)
275
274
else ()
276
- message (WARNING "UR_FORMAT_CPP_STYLE not set. Targets: 'generate' and 'check-generated' and not available" )
275
+ message (WARNING "UR_FORMAT_CPP_STYLE not set. Targets: 'generate' and 'check-generated' are not available" )
277
276
endif ()
0 commit comments