diff options
| author | ruki <[email protected]> | 2021-11-24 09:30:36 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-11-24 09:30:36 +0800 |
| commit | 2ebc0bd03cf7f2d6be736cc01d6a808e3e03b3f1 (patch) | |
| tree | 6d41aca3e1d4f65818c3d7b30bd51a1f51e1467b /xmake/rules/c++/modules/build_modules/msvc.lua | |
| parent | 12ee3ed6eb196f5d9e5cdeb619c40f51b2bec144 (diff) | |
Update msvc.lua
Diffstat (limited to 'xmake/rules/c++/modules/build_modules/msvc.lua')
| -rw-r--r-- | xmake/rules/c++/modules/build_modules/msvc.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/build_modules/msvc.lua b/xmake/rules/c++/modules/build_modules/msvc.lua index 4cc8500ab..1dc04618f 100644 --- a/xmake/rules/c++/modules/build_modules/msvc.lua +++ b/xmake/rules/c++/modules/build_modules/msvc.lua @@ -36,6 +36,17 @@ function load_parent(target, opt) -- add module flags target:add("cxxflags", modulesflag) + + -- get output flag + if compinst:has_flags("/ifcOutput", "cxxflags") then + for _, dep in ipairs(target:orderdeps()) do + local sourcebatches = dep:sourcebatches() + if sourcebatches and sourcebatches["c++.build.modules"] then + local cachedir = path.join(dep:autogendir(), "rules", "modules", "cache") + target:add("cxxflags", "/ifcSearchDir " .. os.args(cachedir), {force = true}) + end + end + end end -- build module files @@ -52,9 +63,7 @@ function build_with_batchjobs(target, batchjobs, sourcebatch, opt) -- get output flag local cachedir local outputflag - local hasifc = false if compinst:has_flags("/ifcOutput", "cxxflags") then - hasifc = true outputflag = "/ifcOutput" cachedir = path.join(target:autogendir(), "rules", "modules", "cache") if not os.isdir(cachedir) then |
