diff options
| author | ruki <[email protected]> | 2023-01-06 23:46:40 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-01-06 23:46:40 +0800 |
| commit | 5ca7b8f9b09f67e74f3b487af2ad4968abb448d7 (patch) | |
| tree | 8b161b1c7e61987dfb40c7df2fdba1c59cf04015 /xmake/rules/c++/modules/modules_support/msvc.lua | |
| parent | 61384ee686c1a008aeae0b47cf59ad96d42f0948 (diff) | |
Update msvc.lua
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/msvc.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/msvc.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua index a7b11ded3..75ce59b84 100644 --- a/xmake/rules/c++/modules/modules_support/msvc.lua +++ b/xmake/rules/c++/modules/modules_support/msvc.lua @@ -137,6 +137,14 @@ function load(target) local modulesflag = get_modulesflag(target) target:add("cxxflags", modulesflag) + -- we detect flags in advance to avoid having to detect them in parallel in parallel tasks. + get_ifcoutputflag(target) + get_ifcsearchdirflag(target) + get_interfaceflag(target) + get_referenceflag(target) + get_headernameflag(target) + get_headerunitflag(target) + -- enable std modules if c++23 by defaults if target:data("c++.msvc.enable_std_import") == nil then local languages = target:get("languages") @@ -659,7 +667,7 @@ function get_ifcoutputflag(target) local ifcoutputflag = _g.ifcoutputflag if ifcoutputflag == nil then local compinst = target:compiler("cxx") - if compinst:has_flags({"-ifcOutput", os.tmpfile()}, "cxxflags", {flagskey = "cl_ifc_output"}) then + if compinst:has_flags("-ifcOutput", "cxxflags", {flagskey = "cl_ifc_output"}) then ifcoutputflag = "-ifcOutput" end assert(ifcoutputflag, "compiler(msvc): does not support c++ module!") @@ -672,7 +680,7 @@ function get_ifcsearchdirflag(target) local ifcsearchdirflag = _g.ifcsearchdirflag if ifcsearchdirflag == nil then local compinst = target:compiler("cxx") - if compinst:has_flags({"-ifcSearchDir", os.tmpdir()}, "cxxflags", {flagskey = "cl_ifc_search_dir"}) then + if compinst:has_flags("-ifcSearchDir", "cxxflags", {flagskey = "cl_ifc_search_dir"}) then ifcsearchdirflag = "-ifcSearchDir" end assert(ifcsearchdirflag, "compiler(msvc): does not support c++ module!") |
