diff options
| author | Ângelo Andrade Cirino <[email protected]> | 2021-07-15 10:49:02 -0300 |
|---|---|---|
| committer | Ângelo Andrade Cirino <[email protected]> | 2021-07-15 10:49:02 -0300 |
| commit | c1b1b841353e32d2df356b8765d1189bef3d2f11 (patch) | |
| tree | f353fb9bfa958022694d1cb66445b8d5a8969a48 /xmake/rules/c++/modules/build_modulefiles.lua | |
| parent | 2e3cad4e9c01e65f9c5da4b32be05ff4754f497b (diff) | |
Additional changes to modules support and corrected the tests
Diffstat (limited to 'xmake/rules/c++/modules/build_modulefiles.lua')
| -rw-r--r-- | xmake/rules/c++/modules/build_modulefiles.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/rules/c++/modules/build_modulefiles.lua b/xmake/rules/c++/modules/build_modulefiles.lua index 9d0eaf276..a36ce49b3 100644 --- a/xmake/rules/c++/modules/build_modulefiles.lua +++ b/xmake/rules/c++/modules/build_modulefiles.lua @@ -35,7 +35,7 @@ function _build_modulefiles_clang(target, sourcebatch, opt) end -- compile module files to *.pcm - opt = table.join(opt, {configs = {force = {cxxflags = {modulesflag, "--precompile", "-x c++-module"}}}}) + opt = table.join(opt, {configs = {force = {cxxflags = {opt.modulesflag, "--precompile", "-x c++-module"}}}}) import("private.action.build.object").build(target, sourcebatch, opt) -- compile *.pcm to object files @@ -48,12 +48,12 @@ function _build_modulefiles_clang(target, sourcebatch, opt) sourcebatch.dependfiles[idx] = target:dependfile(objectfile) table.insert(modulefiles, modulefile) end - opt.configs = {cxxflags = {modulesflag}} + opt.configs = {cxxflags = {opt.modulesflag}} opt.quiet = true import("private.action.build.object").build(target, sourcebatch, opt) -- add module files - target:add("cxxflags", modulesflag) + target:add("cxxflags", opt.modulesflag) for _, modulefile in ipairs(modulefiles) do target:add("cxxflags", "-fmodule-file=" .. modulefile) end @@ -140,9 +140,9 @@ function main(target, sourcebatch, opt) end if modulesflag then opt.modulesflag = modulesflag - if toolname == "clang" then + if string.find(toolname, "clang") then _build_modulefiles_clang(target, sourcebatch, opt) - elseif toolname == "gcc" then + elseif string.find(toolname, "gcc") then _build_modulefiles_gcc(target, sourcebatch, opt) elseif toolname == "cl" then _build_modulefiles_msvc(target, sourcebatch, opt) |
