From 9b3e779d8573ca772d6ad8ba6dfb059bc31feb43 Mon Sep 17 00:00:00 2001 From: MikePopoloski Date: Sun, 20 Oct 2024 16:53:19 -0400 Subject: [PATCH] Add build workaround for Python bindings on Windows when used with other packages that depend on old VC redist versions --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 40433546b..961e53421 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -146,9 +146,15 @@ if(SLANG_FUZZ_TARGET) add_compile_definitions(SLANG_ASSERT_ENABLED) endif() -# mimalloc is incompatible with Python bindings if(SLANG_INCLUDE_PYLIB) + # mimalloc is incompatible with Python bindings set(SLANG_USE_MIMALLOC OFF) + + if(CMAKE_SYSTEM_NAME MATCHES "Windows") + # Workaround incompatibilities with old MSVC runtimes that are distributed + # with some Python packages like PyQt6 + add_compile_definitions(_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) + endif() endif() # Get sane install RPATH handling by default if none has been provided.