diff --git a/xmake/modules/core/tools/emcc.lua b/xmake/modules/core/tools/emcc.lua index 96ee49aa19..11d18bd769 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 32f2960f93..9c407c77de 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