From d0641da8c7f27dfca5b0ae3bc7c737c7859e3939 Mon Sep 17 00:00:00 2001 From: Lujin Wang <143145775+lujinwangnv@users.noreply.github.com> Date: Fri, 10 Oct 2025 17:51:58 -0700 Subject: Update build to allow setting external mimalloc path (#8676) Update the build to allow setting user-specific path for the external module mimalloc. --- CMakeLists.txt | 5 +++++ external/CMakeLists.txt | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc22e75f9..265266da5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -270,6 +270,11 @@ advanced_option( "Build using user defined path for lua" OFF ) +advanced_option( + SLANG_OVERRIDE_MIMALLOC_PATH + "Build using user defined path for mimalloc" + OFF +) advanced_option( SLANG_EXCLUDE_DAWN diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 6b8b5a527..12d5490c7 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -152,8 +152,12 @@ if(SLANG_ENABLE_SLANG_GLSLANG) # Enable mimalloc for SPIRV-Tools to improve compilation performance # Based on SPIRV-Tools PR #6267: https://github.com/KhronosGroup/SPIRV-Tools/pull/6267 if(SLANG_ENABLE_SPIRV_TOOLS_MIMALLOC) - # Place mimalloc in slang/external instead of spirv-tools/external for better organization - set(MIMALLOC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/mimalloc") + if(NOT SLANG_OVERRIDE_MIMALLOC_PATH) + # Place mimalloc in slang/external instead of spirv-tools/external for better organization + set(MIMALLOC_PATH "${CMAKE_CURRENT_SOURCE_DIR}/mimalloc") + else() + set(MIMALLOC_PATH "${SLANG_OVERRIDE_MIMALLOC_PATH}/mimalloc") + endif() # Download mimalloc if it's not available if(NOT EXISTS "${MIMALLOC_PATH}/CMakeLists.txt") -- cgit v1.2.3