@@ -41,31 +41,51 @@ set(UMF_PROXY_LIB_BASED_ON_POOL
41
41
set_property (CACHE UMF_PROXY_LIB_BASED_ON_POOL
42
42
PROPERTY STRINGS ${KNOWN_PROXY_LIB_POOLS} )
43
43
44
- set (KNOWN_BUILD_TYPES Release Debug RelWithDebInfo MinSizeRel)
45
- string (REPLACE ";" " " KNOWN_BUILD_TYPES_STR "${KNOWN_BUILD_TYPES} " )
46
-
47
- if (NOT CMAKE_BUILD_TYPE )
48
- message (
49
- STATUS
50
- "No build type selected (CMAKE_BUILD_TYPE), defaulting to Release" )
51
- set (CMAKE_BUILD_TYPE "Release" )
44
+ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
45
+ set (LINUX TRUE )
46
+ set (OS_NAME "linux" )
47
+ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
48
+ set (WINDOWS TRUE )
49
+ set (OS_NAME "windows" )
50
+ elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
51
+ set (MACOSX TRUE )
52
+ set (OS_NAME "macosx" )
52
53
else ()
53
- message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE} " )
54
- if (NOT CMAKE_BUILD_TYPE IN_LIST KNOWN_BUILD_TYPES)
54
+ message (FATAL_ERROR "Unknown OS type" )
55
+ endif ()
56
+
57
+ # This build type check is not possible on Windows when CMAKE_BUILD_TYPE is not
58
+ # set, because in this case the build type is determined after a CMake
59
+ # configuration is done (at the build time)
60
+ if (NOT WINDOWS)
61
+ set (KNOWN_BUILD_TYPES Release Debug RelWithDebInfo MinSizeRel)
62
+ string (REPLACE ";" " " KNOWN_BUILD_TYPES_STR "${KNOWN_BUILD_TYPES} " )
63
+
64
+ if (NOT CMAKE_BUILD_TYPE )
55
65
message (
56
- WARNING
57
- "Unusual build type was set (${CMAKE_BUILD_TYPE} ), please make sure it is a correct one. "
58
- "The following ones are supported by default: ${KNOWN_BUILD_TYPES_STR} ."
66
+ STATUS
67
+ "No build type selected (CMAKE_BUILD_TYPE), defaulting to Release"
59
68
)
69
+ set (CMAKE_BUILD_TYPE "Release" )
70
+ else ()
71
+ message (STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE} " )
72
+ if (NOT CMAKE_BUILD_TYPE IN_LIST KNOWN_BUILD_TYPES)
73
+ message (
74
+ WARNING
75
+ "Unusual build type was set (${CMAKE_BUILD_TYPE} ), please make sure it is a correct one. "
76
+ "The following ones are supported by default: ${KNOWN_BUILD_TYPES_STR} ."
77
+ )
78
+ endif ()
60
79
endif ()
61
- endif ()
62
80
63
- set (CMAKE_BUILD_TYPE
64
- "${CMAKE_BUILD_TYPE} "
65
- CACHE STRING
66
- "Choose the type of build, options are: ${KNOWN_BUILD_TYPES_STR} ..."
67
- FORCE)
68
- set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${KNOWN_BUILD_TYPES} )
81
+ set (CMAKE_BUILD_TYPE
82
+ "${CMAKE_BUILD_TYPE} "
83
+ CACHE
84
+ STRING
85
+ "Choose the type of build, options are: ${KNOWN_BUILD_TYPES_STR} ..."
86
+ FORCE)
87
+ set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${KNOWN_BUILD_TYPES} )
88
+ endif ()
69
89
70
90
# For using the options listed in the OPTIONS_REQUIRING_CXX variable a C++17
71
91
# compiler is required. Moreover, if these options are not set, CMake will set
@@ -89,19 +109,6 @@ find_package(PkgConfig)
89
109
list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake" )
90
110
include (helpers)
91
111
92
- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" )
93
- set (LINUX TRUE )
94
- set (OS_NAME "linux" )
95
- elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows" )
96
- set (WINDOWS TRUE )
97
- set (OS_NAME "windows" )
98
- elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" )
99
- set (MACOSX TRUE )
100
- set (OS_NAME "macosx" )
101
- else ()
102
- message (FATAL_ERROR "Unknown OS type" )
103
- endif ()
104
-
105
112
# needed when UMF is used as an external project
106
113
set (UMF_CMAKE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR} )
107
114
@@ -190,13 +197,18 @@ if(UMF_BUILD_LIBUMF_POOL_JEMALLOC)
190
197
endif ()
191
198
192
199
# set UMF_PROXY_LIB_ENABLED
193
- if (WINDOWS AND NOT ( CMAKE_BUILD_TYPE STREQUAL "Release" ) )
200
+ if (WINDOWS)
194
201
# TODO: enable the proxy library in the Debug build on Windows
202
+ #
203
+ # In MSVC builds, there is no way to determine the actual build type during
204
+ # the CMake configuration step. Therefore, this message is printed in all
205
+ # MSVC builds.
195
206
message (
196
207
STATUS
197
- "Disabling the proxy library, because it is supported only in the Release build on Windows (CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE} ) "
208
+ "The proxy library will be built, however it is supported only in the Release build on Windows"
198
209
)
199
- elseif (UMF_PROXY_LIB_BASED_ON_POOL STREQUAL SCALABLE)
210
+ endif ()
211
+ if (UMF_PROXY_LIB_BASED_ON_POOL STREQUAL SCALABLE)
200
212
if (UMF_BUILD_LIBUMF_POOL_SCALABLE)
201
213
set (UMF_PROXY_LIB_ENABLED ON )
202
214
set (PROXY_LIB_USES_SCALABLE_POOL ON )
0 commit comments