From 7746d3d387cc524577291972a927787be54e2cad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20H=C3=B6ster?= Date: Mon, 19 Oct 2026 23:14:55 +0200 Subject: [PATCH] inherit clang in emcc and do not pass -c to preprocessor in build_cache --- xmake/modules/core/tools/emcc.lua | 4 ++-- xmake/modules/core/tools/gcc.lua | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/xmake/modules/core/tools/emcc.lua b/xmake/modules/core/tools/emcc.lua index 96ee49aa19c..11d18bd769b 100644 --- a/xmake/modules/core/tools/emcc.lua +++ b/xmake/modules/core/tools/emcc.lua @@ -18,8 +18,8 @@ -- @file emcc.lua -- --- inherit gcc -inherit("gcc") +-- inherit clang +inherit("clang") -- make the optimize flag -- diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 32f2960f934..9c407c77de5 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -185,7 +185,9 @@ function _preprocess(program, argv, opt) end -- get preprocessor flags - table.insert(cppflags, flag) + if flag ~= "-c" then + table.insert(cppflags, flag) + end -- for c++ modules, we cannot support it for clang now if is_clang and flag:startswith("-fmodules") then