diff options
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/msvc.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/msvc.lua | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua index 8003ea9dc..2d53eb0fc 100644 --- a/xmake/rules/c++/modules/modules_support/msvc.lua +++ b/xmake/rules/c++/modules/modules_support/msvc.lua @@ -61,10 +61,10 @@ function _get_modulemap_from_mapper(target) end -- do compile -function _compile(target, argv) +function _compile(target, flags) local compinst = target:compiler("cxx") local msvc = target:toolchain("msvc") - os.iorunv(compinst:program(), winos.cmdargv(argv), {envs = msvc:runenvs()}) + os.iorunv(compinst:program(), winos.cmdargv(table.join(compinst:compflags({target = target}), flags)), {envs = msvc:runenvs()}) end -- add an objectfile to the linker flags @@ -125,7 +125,6 @@ end -- generate dependency files function generate_dependencies(target, sourcebatch, opt) - local compinst = target:compiler("cxx") local scandependenciesflag = get_scandependenciesflag(target) local common_flags = {"-TP", scandependenciesflag} local cachedir = common.modules_cachedir(target) @@ -144,7 +143,7 @@ function generate_dependencies(target, sourcebatch, opt) local jsonfile = path.join(outputdir, path.filename(sourcefile) .. ".json") if scandependenciesflag then local flags = {jsonfile, sourcefile, "-Fo" .. target:objectfile(sourcefile)} - _compile(target, table.join(compinst:compflags({target = target}), common_flags, flags)) + _compile(target, table.join(common_flags, flags)) else common.fallback_generate_dependencies(target, jsonfile, sourcefile) end @@ -161,11 +160,10 @@ end function generate_headerunit_for_batchjob(target, name, flags, objectfile, index, total) -- don't generate same header unit bmi at the same time across targets if not common.memcache():get2(name, "generating") then - local compinst = target:compiler("cxx") local common_flags = {"-TP", "-c"} common.memcache():set2(name, "generating", true) progress.show((index * 100) / total, "${color.build.object}generating.cxx.headerunit.bmi %s", name) - _compile(target, table.join(compinst:compflags({target = target}), common_flags, flags)) + _compile(target, table.join(common_flags, flags)) _add_objectfile_to_link_arguments(target, objectfile) end end @@ -358,7 +356,6 @@ end -- build module files for batchjobs function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, opt) - local compinst = target:compiler("cxx") -- get flags local ifcoutputflag = get_ifcoutputflag(target) @@ -411,7 +408,7 @@ function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, op bmifile, provide.sourcefile } - _compile(target, table.join(compinst:compflags({target = target}), common_flags, requiresflags or {}, flags)) + _compile(target, table.join(common_flags, requiresflags or {}, flags)) end, {dependfile = target:dependfile(bmifile), files = {provide.sourcefile}}) _add_module_to_mapper(target, referenceflag, name, name, objectfile, bmifile, requiresflags) end) |
