1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-13 11:19:50 +03:00
aports/community/mimalloc2/cmake-add-insecure-suffix.patch
2025-05-08 18:39:48 +00:00

43 lines
1.3 KiB
Diff

Updated: 20 Feb 2021 by Nicolas Lorin <androw95220@gmail.com>
From: Jakub Jirutka <jakub@jirutka.cz>
Date: Thu, 19 Aug 2021 23:08:13 +0200
Subject: Add suffix "-insecure" to library with MI_SECURE=OFF
We want to make the secure variant the default one.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 74c1f29..1e94df0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -111,12 +111,7 @@
message(STATUS "For example: 'cmake --build . --config=Release")
endif()
-if("${CMAKE_BINARY_DIR}" MATCHES ".*(S|s)ecure$")
- message(STATUS "Default to secure build")
- set(MI_SECURE "ON")
-endif()
-
# Determine architecture
set(MI_OPT_ARCH_FLAGS "")
set(MI_ARCH "unknown")
@@ -523,6 +518,8 @@
set(mi_libname "mimalloc")
if(MI_SECURE)
set(mi_libname "${mi_libname}-secure")
+else()
+ set(mi_libname "${mi_libname}-insecure")
endif()
if(MI_TRACK_VALGRIND)
set(mi_libname "${mi_libname}-valgrind")
@@ -535,7 +532,7 @@
if(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel|none)$")
list(APPEND mi_defines MI_BUILD_RELEASE)
else()
- set(mi_libname "${mi_libname}-${CMAKE_BUILD_TYPE_LC}") #append build type (e.g. -debug) if not a release version
+ set(mi_libname "mimalloc-${CMAKE_BUILD_TYPE_LC}") #append build type (e.g. -debug) if not a release version
endif()
if(MI_BUILD_SHARED)