Skip to content

Commit 0112317

Browse files
lukaszstolarczukbratpiorka
authored andcommitted
[CMake] Add missing UMF_ prefix in 'public' umf options
1 parent 61980a0 commit 0112317

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
8080
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
8181
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
82-
-DUSE_VALGRIND=1
82+
-DUMF_USE_VALGRIND=1
8383
-DUMF_TESTS_FAIL_ON_SKIP=ON
8484
8585
- name: Build

.github/workflows/sanitizers.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ jobs:
5959
-DUMF_DEVELOPER_MODE=ON
6060
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
6161
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
62-
-DUSE_ASAN=${{matrix.sanitizers.asan}}
63-
-DUSE_UBSAN=${{matrix.sanitizers.ubsan}}
64-
-DUSE_TSAN=${{matrix.sanitizers.tsan}}
62+
-DUMF_USE_ASAN=${{matrix.sanitizers.asan}}
63+
-DUMF_USE_UBSAN=${{matrix.sanitizers.ubsan}}
64+
-DUMF_USE_TSAN=${{matrix.sanitizers.tsan}}
6565
-DUMF_BUILD_EXAMPLES=ON
6666
-DUMF_TESTS_FAIL_ON_SKIP=ON
6767
@@ -127,7 +127,7 @@ jobs:
127127
-DUMF_FORMAT_CODE_STYLE=OFF
128128
-DUMF_DEVELOPER_MODE=ON
129129
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
130-
-DUSE_ASAN=${{matrix.sanitizers.asan}}
130+
-DUMF_USE_ASAN=${{matrix.sanitizers.asan}}
131131
-DUMF_BUILD_EXAMPLES=ON
132132
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
133133
-DUMF_TESTS_FAIL_ON_SKIP=ON

.github/workflows/valgrind.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
3636
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
3737
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=OFF
38-
-DUSE_VALGRIND=1
38+
-DUMF_USE_VALGRIND=1
3939
-DUMF_TESTS_FAIL_ON_SKIP=ON
4040
4141
- name: Build

CMakeLists.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ option(UMF_FORMAT_CODE_STYLE
5757
OFF)
5858
# Only a part of skips is treated as a failure now. TODO: extend to all tests
5959
option(UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF)
60-
option(USE_ASAN "Enable AddressSanitizer checks" OFF)
61-
option(USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF)
62-
option(USE_TSAN "Enable ThreadSanitizer checks" OFF)
63-
option(USE_MSAN "Enable MemorySanitizer checks" OFF)
64-
option(USE_VALGRIND "Enable Valgrind instrumentation" OFF)
65-
option(USE_GCOV "Enable gcov support" OFF)
60+
option(UMF_USE_ASAN "Enable AddressSanitizer checks" OFF)
61+
option(UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF)
62+
option(UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF)
63+
option(UMF_USE_MSAN "Enable MemorySanitizer checks" OFF)
64+
option(UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF)
65+
option(UMF_USE_GCOV "Enable gcov support" OFF)
6666
option(
6767
UMF_DISABLE_HWLOC
6868
"Disable features that requires hwloc (OS provider, memory targets, topology discovery)"
@@ -266,16 +266,16 @@ if(MSVC)
266266
endif()
267267

268268
# Sanitizer flags
269-
if(USE_ASAN)
269+
if(UMF_USE_ASAN)
270270
add_sanitizer_flag(address)
271271
endif()
272-
if(USE_UBSAN)
272+
if(UMF_USE_UBSAN)
273273
add_sanitizer_flag(undefined)
274274
endif()
275-
if(USE_TSAN)
275+
if(UMF_USE_TSAN)
276276
add_sanitizer_flag(thread)
277277
endif()
278-
if(USE_MSAN)
278+
if(UMF_USE_MSAN)
279279
message(WARNING "MemorySanitizer requires instrumented libraries to "
280280
"prevent reporting false-positives")
281281
add_sanitizer_flag(memory)

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,12 @@ origin: https://dependency_origin.com
207207
## Code coverage
208208

209209
After adding a new functionality add tests and check coverage before and after the change.
210-
To do this, enable coverage instrumentation by turning on the USE_GCOV flag in CMake.
210+
To do this, enable coverage instrumentation by turning on the UMF_USE_GCOV flag in CMake.
211211
Coverage instrumentation feature is supported only by GCC and Clang.
212212
An example flow might look like the following:
213213

214214
```bash
215-
$ cmake -B build -DUSE_GCOV=1 -DCMAKE_BUILD_TYPE=Debug
215+
$ cmake -B build -DUMF_USE_GCOV=1 -DCMAKE_BUILD_TYPE=Debug
216216
$ cmake --build build -j
217217
$ cd build
218218
$ ctest

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ List of options provided by CMake:
112112
| UMF_DEVELOPER_MODE | Enable additional developer checks | ON/OFF | OFF |
113113
| UMF_FORMAT_CODE_STYLE | Add clang, cmake, and black -format-check and -format-apply targets to make | ON/OFF | OFF |
114114
| UMF_TESTS_FAIL_ON_SKIP | Treat skips in tests as fail | ON/OFF | OFF |
115-
| USE_ASAN | Enable AddressSanitizer checks | ON/OFF | OFF |
116-
| USE_UBSAN | Enable UndefinedBehaviorSanitizer checks | ON/OFF | OFF |
117-
| USE_TSAN | Enable ThreadSanitizer checks | ON/OFF | OFF |
118-
| USE_MSAN | Enable MemorySanitizer checks | ON/OFF | OFF |
119-
| USE_VALGRIND | Enable Valgrind instrumentation | ON/OFF | OFF |
120-
| USE_GCOV | Enable gcov support (Linux only) | ON/OFF | OFF |
115+
| UMF_USE_ASAN | Enable AddressSanitizer checks | ON/OFF | OFF |
116+
| UMF_USE_UBSAN | Enable UndefinedBehaviorSanitizer checks | ON/OFF | OFF |
117+
| UMF_USE_TSAN | Enable ThreadSanitizer checks | ON/OFF | OFF |
118+
| UMF_USE_MSAN | Enable MemorySanitizer checks | ON/OFF | OFF |
119+
| UMF_USE_VALGRIND | Enable Valgrind instrumentation | ON/OFF | OFF |
120+
| UMF_USE_GCOV | Enable gcov support (Linux only) | ON/OFF | OFF |
121121
| UMF_LINK_HWLOC_STATICALLY | Link UMF with HWLOC library statically (Windows+Release only) | ON/OFF | OFF |
122122
| UMF_DISABLE_HWLOC | Disable features that requires hwloc (OS provider, memory targets, topology discovery) | ON/OFF | OFF |
123123

cmake/helpers.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ function(add_umf_target_compile_options name)
218218
target_compile_options(${name} PRIVATE -fno-omit-frame-pointer
219219
-fstack-protector-strong)
220220
endif()
221-
if(USE_GCOV)
221+
if(UMF_USE_GCOV)
222222
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
223223
message(FATAL_ERROR "To use gcov, the build type must be Debug")
224224
endif()
@@ -254,7 +254,7 @@ function(add_umf_target_link_options name)
254254
if(NOT MSVC)
255255
if(NOT APPLE)
256256
target_link_options(${name} PRIVATE "LINKER:-z,relro,-z,now")
257-
if(USE_GCOV)
257+
if(UMF_USE_GCOV)
258258
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
259259
message(
260260
FATAL_ERROR "To use gcov, the build type must be Debug")

src/utils/CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ set(UMF_UTILS_SOURCES_POSIX utils_posix_common.c utils_posix_concurrency.c
1313
set(UMF_UTILS_SOURCES_WINDOWS utils_windows_common.c
1414
utils_windows_concurrency.c utils_windows_math.c)
1515

16-
if(USE_VALGRIND)
17-
if(USE_ASAN
18-
OR USE_TSAN
19-
OR USE_UBSAN
20-
OR USE_MSAN)
16+
if(UMF_USE_VALGRIND)
17+
if(UMF_USE_ASAN
18+
OR UMF_USE_TSAN
19+
OR UMF_USE_UBSAN
20+
OR UMF_USE_MSAN)
2121
message(FATAL_ERROR "Cannot use valgrind and sanitizers together")
2222
endif()
2323

@@ -51,7 +51,7 @@ target_include_directories(
5151
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
5252
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
5353

54-
if(USE_VALGRIND)
54+
if(UMF_USE_VALGRIND)
5555
set(UMF_UTILS_INTERFACE_DEFS "UMF_VG_ENABLED=1")
5656
endif()
5757

test/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ endif()
394394
if(LINUX
395395
AND UMF_BUILD_SHARED_LIBRARY
396396
AND NOT
397-
(USE_ASAN
398-
OR USE_UBSAN
399-
OR USE_TSAN
400-
OR USE_MSAN))
397+
(UMF_USE_ASAN
398+
OR UMF_USE_UBSAN
399+
OR UMF_USE_TSAN
400+
OR UMF_USE_MSAN))
401401
set(EXAMPLES "")
402402
if(UMF_POOL_SCALABLE_ENABLED)
403403
set(EXAMPLES ${EXAMPLES} basic)

0 commit comments

Comments
 (0)