From e55b6a9e4bcc2d6c2e4faa1d85d71394ea98c076 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 23 Aug 2023 22:36:12 +0100 Subject: [PATCH 1/3] Disable empty static prefix for Windows. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a77b6b42a..817d7f6b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,10 @@ if (SNMALLOC_SANITIZER) message(STATUS "Using sanitizer=${SNMALLOC_SANITIZER}") endif() +if(MSVC AND NOT (SNMALLOC_STATIC_LIBRARY_PREFIX STREQUAL "")) + message(FATAL_ERROR "Empty static library prefix not supported on MSVC") +endif() + # If CheckLinkerFlag doesn't exist then provide a dummy implementation that # always fails. The fallback can be removed when we move to CMake 3.18 as the # baseline. From 616053e521ccfeb25dc68e92f4cf9a554a41f3e2 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Wed, 23 Aug 2023 22:55:10 +0100 Subject: [PATCH 2/3] Fix --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 817d7f6b3..a54602676 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if (SNMALLOC_SANITIZER) message(STATUS "Using sanitizer=${SNMALLOC_SANITIZER}") endif() -if(MSVC AND NOT (SNMALLOC_STATIC_LIBRARY_PREFIX STREQUAL "")) +if(MSVC AND SNMALLOC_STATIC_LIBRARY AND NOT (SNMALLOC_STATIC_LIBRARY_PREFIX STREQUAL "")) message(FATAL_ERROR "Empty static library prefix not supported on MSVC") endif() From c5437a55feafe51d602ca9febb7a4e12736c6d6b Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Thu, 24 Aug 2023 10:25:16 +0100 Subject: [PATCH 3/3] Fix logic. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a54602676..e4dff0430 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if (SNMALLOC_SANITIZER) message(STATUS "Using sanitizer=${SNMALLOC_SANITIZER}") endif() -if(MSVC AND SNMALLOC_STATIC_LIBRARY AND NOT (SNMALLOC_STATIC_LIBRARY_PREFIX STREQUAL "")) +if(MSVC AND SNMALLOC_STATIC_LIBRARY AND (SNMALLOC_STATIC_LIBRARY_PREFIX STREQUAL "")) message(FATAL_ERROR "Empty static library prefix not supported on MSVC") endif()