From 7b597335aedc2c60b0174f6e67a7f7560f841760 Mon Sep 17 00:00:00 2001 From: Matthew Parkinson Date: Fri, 25 Aug 2023 14:17:04 +0100 Subject: [PATCH] Disable empty static prefix for Windows. (#629) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a77b6b4..e4dff04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,10 @@ if (SNMALLOC_SANITIZER) message(STATUS "Using sanitizer=${SNMALLOC_SANITIZER}") endif() +if(MSVC AND SNMALLOC_STATIC_LIBRARY AND (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.