diff options
| author | ruki <[email protected]> | 2026-07-02 23:52:54 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-07-08 22:17:00 +0800 |
| commit | fa23c322f7e7f1944420cae964bc8f6a6c99b811 (patch) | |
| tree | 6ef1096a9848ecdf31c517c3f055ce5a7224062d | |
| parent | 6133f843f898f3be4181a10bfa4ce5b310e44804 (diff) | |
fix crash in contains modules
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 1119cd123..32f2960f9 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -976,7 +976,8 @@ function compargv(self, sourcefile, objectfile, flags, opt) if toolchain_utils.is_cxx_headerext(extension) then flags = _translate_flags_for_pch(self, flags) elseif support.has_module_extension(sourcefile, {extension = extension}) - or (opt.target and support.contains_modules(opt.target) + or (opt.target and opt.target:type() == "target" + and support.contains_modules(opt.target) and support.is_stdmodule_file(opt.target, sourcefile)) then flags = _translate_flags_for_mpp(self, flags) end |
