summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGangzheng Tong <tonggangzheng@gmail.com>2025-09-17 12:27:57 -0700
committerGitHub <noreply@github.com>2025-09-17 19:27:57 +0000
commit58060d2f7e86427124551f3f6edcf05bf6e4d229 (patch)
treea419a548534c48f586ea018b35ec900c681f3842
parent8d67365b36ea43d339911eba5ee1693d75ae58e2 (diff)
Set default mimalloc for spirv-tools but allow user to override (#8460)
This PR resolves a configuration conflict where the SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC option was defined twice with different defaults, causing user settings to be overridden. Changes: - Removed duplicate definition in external/CMakeLists.txt that only applied to WIN32 - Define default in main CMakeLists.txt - ON by default for Windows - OFF by default for other platforms (still need to resolve crashes so set it to `OFF` for now) Preserved user configuration - explicit -DSLANG_ENABLE_SPIRV_TOOLS_MIMALLOC=value settings are now properly respected Related to https://github.com/shader-slang/slang/issues/8158 --------- Co-authored-by: slangbot <ellieh+slangbot@nvidia.com> Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com>
-rw-r--r--CMakeLists.txt8
-rw-r--r--external/CMakeLists.txt9
2 files changed, 7 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab4556550..ae99959f7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -185,10 +185,16 @@ advanced_option(
"Build using system glslang library"
OFF
)
+if(WIN32)
+ set(SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC_DEFAULT ON)
+else()
+ set(SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC_DEFAULT OFF)
+endif()
+
advanced_option(
SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC
"Enable mimalloc for SPIRV-Tools to improve compilation performance"
- OFF
+ ${SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC_DEFAULT}
)
option(
diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt
index fed9e5e4e..e0dcdfb40 100644
--- a/external/CMakeLists.txt
+++ b/external/CMakeLists.txt
@@ -25,15 +25,6 @@ if(NOT SLANG_ENABLE_EXTERNAL_COMPILER_WARNINGS)
endif()
endif()
-# Option to enable mimalloc for SPIRV-Tools to improve compilation performance
-if(WIN32)
- option(
- SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC
- "Enable mimalloc for SPIRV-Tools to improve compilation performance"
- ON
- )
-endif()
-
# Unordered dense
if(NOT ${SLANG_USE_SYSTEM_UNORDERED_DENSE})
if(NOT SLANG_OVERRIDE_UNORDERED_DENSE_PATH)