@@ -10,6 +10,10 @@ list(APPEND CMAKE_MODULE_PATH "${UMF_CMAKE_SOURCE_DIR}/cmake")
10
10
# Use full path of the helpers module (to omit potential conflicts with others)
11
11
include (${UMF_CMAKE_SOURCE_DIR} /cmake/helpers.cmake )
12
12
13
+ # --------------------------------------------------------------------------- #
14
+ # Set UMF version variables, define project, and add basic modules
15
+ # --------------------------------------------------------------------------- #
16
+
13
17
# We use semver aligned version, set via git tags. We parse git output to
14
18
# establish the version of UMF to be used in CMake, Win dll's, and within the
15
19
# code (e.g. in logger). We have 3-component releases (e.g. 1.5.1) plus release
@@ -33,6 +37,10 @@ include(CMakePackageConfigHelpers)
33
37
include (GNUInstallDirs )
34
38
find_package (PkgConfig )
35
39
40
+ # --------------------------------------------------------------------------- #
41
+ # Set UMF build options (and CACHE variables)
42
+ # --------------------------------------------------------------------------- #
43
+
36
44
# Define a list to store the names of all options
37
45
set (UMF_OPTIONS_LIST "" )
38
46
list (APPEND UMF_OPTIONS_LIST CMAKE_BUILD_TYPE )
@@ -43,7 +51,6 @@ macro(umf_option)
43
51
option (${ARGV} )
44
52
endmacro ()
45
53
46
- # Build Options
47
54
umf_option (UMF_BUILD_SHARED_LIBRARY "Build UMF as shared library" OFF )
48
55
umf_option (UMF_BUILD_LEVEL_ZERO_PROVIDER "Build Level Zero memory provider" ON )
49
56
umf_option (UMF_BUILD_CUDA_PROVIDER "Build CUDA memory provider" ON )
@@ -56,9 +63,8 @@ umf_option(UMF_BUILD_GPU_TESTS "Build UMF GPU tests" OFF)
56
63
umf_option (UMF_BUILD_BENCHMARKS "Build UMF benchmarks" OFF )
57
64
umf_option (UMF_BUILD_BENCHMARKS_MT "Build UMF multithreaded benchmarks" OFF )
58
65
umf_option (UMF_BUILD_EXAMPLES "Build UMF examples" ON )
59
- umf_option (UMF_BUILD_FUZZTESTS "Build UMF fuzz tests" OFF )
60
66
umf_option (UMF_BUILD_GPU_EXAMPLES "Build UMF GPU examples" OFF )
61
- umf_option (UMF_DEVELOPER_MODE "Enable additional developer checks " OFF )
67
+ umf_option (UMF_BUILD_FUZZTESTS "Build UMF fuzz tests " OFF )
62
68
umf_option (
63
69
UMF_DISABLE_HWLOC
64
70
"Disable hwloc and UMF features requiring it (OS provider, memtargets, topology discovery)"
@@ -67,9 +73,6 @@ umf_option(
67
73
UMF_LINK_HWLOC_STATICALLY
68
74
"Link UMF with HWLOC library statically (proxy library will be disabled on Windows+Debug build)"
69
75
OFF )
70
- umf_option (
71
- UMF_FORMAT_CODE_STYLE
72
- "Add clang, cmake, and black -format-check and -format-apply targets" OFF )
73
76
set (UMF_HWLOC_NAME
74
77
"hwloc"
75
78
CACHE STRING "Custom name for hwloc library w/o extension" )
@@ -81,6 +84,10 @@ set(UMF_INSTALL_RPATH
81
84
"Set the runtime search path to the directory with dependencies (e.g. hwloc)"
82
85
)
83
86
87
+ umf_option (UMF_DEVELOPER_MODE "Enable additional developer checks" OFF )
88
+ umf_option (
89
+ UMF_FORMAT_CODE_STYLE
90
+ "Add clang, cmake, and black -format-check and -format-apply targets" OFF )
84
91
# Only a part of skips is treated as a failure now. TODO: extend to all tests
85
92
umf_option (UMF_TESTS_FAIL_ON_SKIP "Treat skips in tests as fail" OFF )
86
93
umf_option (UMF_USE_ASAN "Enable AddressSanitizer checks" OFF )
@@ -100,6 +107,11 @@ set_property(CACHE UMF_PROXY_LIB_BASED_ON_POOL
100
107
PROPERTY STRINGS ${KNOWN_PROXY_LIB_POOLS} )
101
108
list (APPEND UMF_OPTIONS_LIST UMF_PROXY_LIB_BASED_ON_POOL )
102
109
110
+ # --------------------------------------------------------------------------- #
111
+ # Setup required variables, definitions; fetch dependencies; include
112
+ # sub_directories based on build options; set flags; etc.
113
+ # --------------------------------------------------------------------------- #
114
+
103
115
if (UMF_BUILD_TESTS
104
116
AND DEFINED ENV{CI}
105
117
AND NOT UMF_TESTS_FAIL_ON_SKIP )
@@ -711,7 +723,7 @@ if(UMF_FORMAT_CODE_STYLE)
711
723
add_custom_target (
712
724
cmake-format-apply
713
725
COMMAND ${CMAKE_FORMAT} --in-place ${format_cmake_list}
714
- COMMENT "Format Cmake files using cmake-format" )
726
+ COMMENT "Format CMake files using cmake-format" )
715
727
endif ()
716
728
717
729
if (BLACK )
0 commit comments