@@ -33,36 +33,47 @@ include(CMakePackageConfigHelpers)
3333include (GNUInstallDirs)
3434find_package (PkgConfig)
3535
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+
3646# 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 (
5363 UMF_DISABLE_HWLOC
5464 "Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)"
5565 OFF )
56- option (
66+ umf_option (
5767 UMF_LINK_HWLOC_STATICALLY
5868 "Link UMF with HWLOC library statically (supported for Linux, MacOS and Release build on Windows)"
5969 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 )
6373set (UMF_HWLOC_NAME
6474 "hwloc"
6575 CACHE STRING "Custom name for hwloc library w/o extension" )
76+ list (APPEND UMF_OPTIONS_LIST UMF_HWLOC_NAME)
6677set (UMF_INSTALL_RPATH
6778 ""
6879 CACHE
@@ -71,13 +82,13 @@ set(UMF_INSTALL_RPATH
7182)
7283
7384# 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 )
8192
8293# set UMF_PROXY_LIB_BASED_ON_POOL to one of: SCALABLE or JEMALLOC
8394set (KNOWN_PROXY_LIB_POOLS SCALABLE JEMALLOC)
@@ -87,6 +98,7 @@ set(UMF_PROXY_LIB_BASED_ON_POOL
8798 "A UMF pool the proxy library is based on (SCALABLE or JEMALLOC)" )
8899set_property (CACHE UMF_PROXY_LIB_BASED_ON_POOL
89100 PROPERTY STRINGS ${KNOWN_PROXY_LIB_POOLS} )
101+ list (APPEND UMF_OPTIONS_LIST UMF_PROXY_LIB_BASED_ON_POOL)
90102
91103if (UMF_BUILD_TESTS
92104 AND DEFINED ENV{CI}
0 commit comments