@@ -33,36 +33,47 @@ include(CMakePackageConfigHelpers)
33
33
include (GNUInstallDirs)
34
34
find_package (PkgConfig)
35
35
36
+ # Define a list to store the names of all options
37
+ set (UMF_OPTIONS_LIST "" )
38
+ list (APPEND UMF_OPTIONS_LIST CMAKE_BUILD_TYPE )
39
+
40
+ # Define a macro to wrap the option() command and track the options
41
+ macro (umf_option)
42
+ list (APPEND UMF_OPTIONS_LIST ${ARGV0} )
43
+ option (${ARGV} )
44
+ endmacro ()
45
+
36
46
# Build Options
37
- option (UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF )
38
- option (UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON )
39
- option (UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON )
40
- option (UMF_BUILD_LIBUMF_POOL_DISJOINT
41
- "Build the libumf_pool_disjoint static library" OFF )
42
- option (UMF_BUILD_LIBUMF_POOL_JEMALLOC
43
- "Build the libumf_pool_jemalloc static library" OFF )
44
- option (UMF_BUILD_TESTS "Build UMF tests" ON )
45
- option (UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF )
46
- option (UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF )
47
- option (UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF )
48
- option (UMF_BUILD_EXAMPLES "Build UMF examples" ON )
49
- option (UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF )
50
- option (UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF )
51
- option (UMF_DEVELOPER_MODE "Enable additional developer checks" OFF )
52
- option (
47
+ umf_option (UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF )
48
+ umf_option (UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON )
49
+ umf_option (UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON )
50
+ umf_option (UMF_BUILD_LIBUMF_POOL_DISJOINT
51
+ "Build the libumf_pool_disjoint static library" OFF )
52
+ umf_option (UMF_BUILD_LIBUMF_POOL_JEMALLOC
53
+ "Build the libumf_pool_jemalloc static library" OFF )
54
+ umf_option (UMF_BUILD_TESTS "Build UMF tests" ON )
55
+ umf_option (UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF )
56
+ umf_option (UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF )
57
+ umf_option (UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF )
58
+ umf_option (UMF_BUILD_EXAMPLES "Build UMF examples" ON )
59
+ umf_option (UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF )
60
+ umf_option (UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF )
61
+ umf_option (UMF_DEVELOPER_MODE "Enable additional developer checks" OFF )
62
+ umf_option (
53
63
UMF_DISABLE_HWLOC
54
64
"Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)"
55
65
OFF )
56
- option (
66
+ umf_option (
57
67
UMF_LINK_HWLOC_STATICALLY
58
68
"Link UMF with HWLOC library statically (supported for Linux, MacOS and Release build on Windows)"
59
69
OFF )
60
- option (UMF_FORMAT_CODE_STYLE
61
- "Add clang, cmake, and black -format-check and -format-apply targets"
62
- OFF )
70
+ umf_option(
71
+ UMF_FORMAT_CODE_STYLE
72
+ "Add clang, cmake, and black -format-check and -format-apply targets" OFF )
63
73
set (UMF_HWLOC_NAME
64
74
"hwloc"
65
75
CACHE STRING "Custom name for hwloc library w/o extension" )
76
+ list (APPEND UMF_OPTIONS_LIST UMF_HWLOC_NAME)
66
77
set (UMF_INSTALL_RPATH
67
78
""
68
79
CACHE
@@ -71,13 +82,13 @@ set(UMF_INSTALL_RPATH
71
82
)
72
83
73
84
# Only a part of skips is treated as a failure now. TODO: extend to all tests
74
- option (UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF )
75
- option (UMF_USE_ASAN "Enable AddressSanitizer checks" OFF )
76
- option (UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF )
77
- option (UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF )
78
- option (UMF_USE_MSAN "Enable MemorySanitizer checks" OFF )
79
- option (UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF )
80
- option (UMF_USE_COVERAGE "Build with coverage enabled (Linux only)" OFF )
85
+ umf_option (UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF )
86
+ umf_option (UMF_USE_ASAN "Enable AddressSanitizer checks" OFF )
87
+ umf_option (UMF_USE_UBSAN "Enable UndefinedBehaviorSanitizer checks" OFF )
88
+ umf_option (UMF_USE_TSAN "Enable ThreadSanitizer checks" OFF )
89
+ umf_option (UMF_USE_MSAN "Enable MemorySanitizer checks" OFF )
90
+ umf_option (UMF_USE_VALGRIND "Enable Valgrind instrumentation" OFF )
91
+ umf_option (UMF_USE_COVERAGE "Build with coverage enabled (Linux only)" OFF )
81
92
82
93
# set UMF_PROXY_LIB_BASED_ON_POOL to one of: SCALABLE or JEMALLOC
83
94
set (KNOWN_PROXY_LIB_POOLS SCALABLE JEMALLOC)
@@ -87,6 +98,7 @@ set(UMF_PROXY_LIB_BASED_ON_POOL
87
98
"A UMF pool the proxy library is based on (SCALABLE or JEMALLOC)" )
88
99
set_property (CACHE UMF_PROXY_LIB_BASED_ON_POOL
89
100
PROPERTY STRINGS ${KNOWN_PROXY_LIB_POOLS} )
101
+ list (APPEND UMF_OPTIONS_LIST UMF_PROXY_LIB_BASED_ON_POOL)
90
102
91
103
if (UMF_BUILD_TESTS
92
104
AND DEFINED ENV{CI}
0 commit comments