summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergei Kachkov <kachkov98@gmail.com>2025-08-21 20:41:24 +0300
committerGitHub <noreply@github.com>2025-08-21 17:41:24 +0000
commit44815ba48c1d149137a2210ca3fccfe3bda2626e (patch)
treed51eba90f65e7a344246b64c06b4fefcfc2de2d1
parentc45f02579076fcf559f92be501d8293d308db34e (diff)
Fix SLANGC_EXECUTABLE search path in slangConfig.cmake (#8200)
This patch changes the order of searching slangc executable. This bug affects the following scenario: let's assume that user has a binary release of slang package and wants to use it via `find_package(slang CONFIG HINTS <path to binary release>)`, but there is also an environment variable that points to some other slang release (e.g. user has Vulkan SDK in the `$PATH`). In that case, find_package will successfully find a desired slang package, but find_program in slangConfig.cmake will check environment variable first, and in the result SLANGC_EXECUTABLE will point to slangc from Vulkan SDK and not from the downloaded package. Co-authored-by: Ellie Hermaszewska <ellieh@nvidia.com>
-rw-r--r--cmake/SlangConfig.cmake.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/SlangConfig.cmake.in b/cmake/SlangConfig.cmake.in
index 253958690..7b7a0eb98 100644
--- a/cmake/SlangConfig.cmake.in
+++ b/cmake/SlangConfig.cmake.in
@@ -8,7 +8,7 @@ endif()
if(@SLANG_ENABLE_SLANGC@)
- find_program(SLANGC_EXECUTABLE "slangc" HINTS ENV PATH "${PACKAGE_PREFIX_DIR}/bin")
+ find_program(SLANGC_EXECUTABLE "slangc" HINTS "${PACKAGE_PREFIX_DIR}/bin" ENV PATH)
if (NOT SLANGC_EXECUTABLE)
message(STATUS "slangc executable not found; ensure it is available in your PATH.")