diff options
author | daan <daan@effp.org> | 2022-10-30 14:20:35 -0700 |
---|---|---|
committer | daan <daan@effp.org> | 2022-10-30 14:20:35 -0700 |
commit | 74d002b61ceaa9d26d5fb731ba5b4bbb764b98a7 (patch) | |
tree | 501818bfccaf3c70d3f7e67988c5b141178ec8f4 | |
parent | 05a75758dd41eb8e12d0155556364c427eaa93eb (diff) |
better cmake process for MI_VALGRIND
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 93fbb1c..d826e64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,6 +108,9 @@ endif() if(MI_SECURE) message(STATUS "Set full secure build (MI_SECURE=ON)") list(APPEND mi_defines MI_SECURE=4) + #if (MI_VALGRIND) + # message(WARNING "Secure mode is a bit weakened when compiling with Valgrind support as buffer overflow detection is no longer byte-precise (if running without valgrind)") + #endif() endif() if(MI_VALGRIND) @@ -265,20 +268,18 @@ else() set(mi_install_cmakedir "${CMAKE_INSTALL_LIBDIR}/cmake/mimalloc-${mi_version}") # for cmake package info endif() +set(mi_basename "mimalloc") if(MI_SECURE) - set(mi_basename "mimalloc-secure") -else() - if(MI_VALGRIND) - set(mi_basename "mimalloc-valgrind") - else() - set(mi_basename "mimalloc") - endif() + set(mi_basename "${mi_basename}-secure") +endif() +if(MI_VALGRIND) + set(mi_basename "${mi_basename}-valgrind") endif() - string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LC) if(NOT(CMAKE_BUILD_TYPE_LC MATCHES "^(release|relwithdebinfo|minsizerel|none)$")) set(mi_basename "${mi_basename}-${CMAKE_BUILD_TYPE_LC}") #append build type (e.g. -debug) if not a release version endif() + if(MI_BUILD_SHARED) list(APPEND mi_build_targets "shared") endif() |