From 6580d1f1a5b4095a274bcd54eae79f61d3e71fb4 Mon Sep 17 00:00:00 2001 From: Gary Hsu Date: Fri, 31 Jul 2026 15:20:31 -0700 Subject: [PATCH] Use an absolute path for CompileShaders.cmd The shader build step names the script as a bare CompileShaders.cmd, which only resolves because Windows falls back to searching the current directory when looking up an executable. That fallback is disabled whenever NoDefaultCurrentDirectoryInExePath is present in the environment, and the build then fails with "no such file or directory". WORKING_DIRECTORY already points at Src/Shaders, so naming the script by absolute path keeps the same intent without relying on current-directory lookup. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 714b4495-258e-4645-abf7-26c17bc29d5b --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1da832dd..e535be55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -274,7 +274,7 @@ if(NOT USE_PREBUILT_SHADERS) MAIN_DEPENDENCY "${PROJECT_SOURCE_DIR}/Src/Shaders/CompileShaders.cmd" DEPENDS ${SHADER_SOURCES} COMMENT "Generating HLSL shaders..." - COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS}" $<$:LegacyShaderCompiler=${DIRECTX_FXC_TOOL}> CompileShaders.cmd ARGS ${ShaderOpts} > "${COMPILED_SHADERS}/compileshaders.log" + COMMAND ${CMAKE_COMMAND} -E env CompileShadersOutput="${COMPILED_SHADERS}" $<$:LegacyShaderCompiler=${DIRECTX_FXC_TOOL}> "${PROJECT_SOURCE_DIR}/Src/Shaders/CompileShaders.cmd" ARGS ${ShaderOpts} > "${COMPILED_SHADERS}/compileshaders.log" WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/Src/Shaders" USES_TERMINAL) endif()