summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRedbeanw44602 <[email protected]>2025-10-21 17:00:47 +0800
committerRedbeanw44602 <[email protected]>2025-10-21 17:00:47 +0800
commited3784b19030e6d0320f7afa139df8fd16e409d3 (patch)
tree20915928245620e64b70af0fea8a025e4ec36fe6
parent59e6cf0f3deba5615a0ce886d8c7e75731f09ca5 (diff)
fix build failure caused by zigcc linker not supporting `--dependency-file` flag.
-rw-r--r--xmake/modules/package/tools/cmake.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/package/tools/cmake.lua b/xmake/modules/package/tools/cmake.lua
index 927f3daf8..73976bd78 100644
--- a/xmake/modules/package/tools/cmake.lua
+++ b/xmake/modules/package/tools/cmake.lua
@@ -392,6 +392,14 @@ function _fix_cxx_compiler_cmake(package, envs)
end
end
+-- @see https://github.com/ziglang/zig/issues/22213
+function _fix_zigcc_linker_cmake(package, envs)
+ if package:has_tool("cc", "zig_cc") then
+ envs.CMAKE_C_LINKER_DEPFILE_SUPPORTED = "FALSE"
+ envs.CMAKE_CXX_LINKER_DEPFILE_SUPPORTED = "FALSE"
+ end
+end
+
-- insert configs from envs
function _insert_configs_from_envs(configs, envs, opt)
opt = opt or {}
@@ -418,6 +426,7 @@ function _get_configs_for_generic(package, configs, opt)
if package:is_library() then
envs.BUILD_SHARED_LIBS = package:config("shared") and "ON" or "OFF"
end
+ _fix_zigcc_linker_cmake(package, envs)
_insert_configs_from_envs(configs, envs, opt)
end