mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-24 03:07:53 +08:00
bb61fc1662
Co-authored-by: Robert Schumacher <roschuma@microsoft.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
21 lines
807 B
Diff
21 lines
807 B
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index e5ab1f460..a23c6dbf5 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -145,12 +145,13 @@ if (${BLAZE_CACHE_SIZE_AUTO})
|
|
endif (flag EQUAL 0)
|
|
endif (APPLE)
|
|
|
|
- if (flag)
|
|
+ string(REGEX MATCH "([0-9][0-9]+)" tmp ${tmp}) # Get a number containing at least 2 digits in the string tmp
|
|
+
|
|
+ if (flag OR NOT tmp)
|
|
message("Cache size not found automatically. Using default value as cache size.")
|
|
set(tmp ${BLAZE_CACHE_SIZE_DEFAULT})
|
|
endif (flag)
|
|
|
|
- string(REGEX MATCH "([0-9][0-9]+)" tmp ${tmp}) # Get a number containing at least 2 digits in the string tmp
|
|
math(EXPR BLAZE_CACHE_SIZE ${tmp}*1024) # Convert to bytes (assuming that the value is given in kibibytes)
|
|
|
|
endif (${BLAZE_CACHE_SIZE_AUTO})
|