From 8215544b0261b8bdb8f95a51901536934ea22325 Mon Sep 17 00:00:00 2001 From: foxtacles Date: Sun, 5 Apr 2026 08:42:52 -0700 Subject: [PATCH] Fix Docker build failure due to missing .git directory (#790) Only add .git/HEAD as a build dependency when it exists, so the Emscripten build succeeds in environments without a .git directory (e.g. Docker). --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be7cc420..f3f6dbd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,8 +22,9 @@ if (EMSCRIPTEN) # Resolve git HEAD to find file dependencies for change detection. # .git/HEAD changes on branch switch; the ref file it points to changes on commit. set(_git_head "${CMAKE_SOURCE_DIR}/.git/HEAD") - set(_git_deps "${_git_head}") + set(_git_deps) if(EXISTS "${_git_head}") + list(APPEND _git_deps "${_git_head}") file(READ "${_git_head}" _head_ref) string(STRIP "${_head_ref}" _head_ref) if(_head_ref MATCHES "^ref: (.+)$")