diff options
| author | Arthur LAURENT <[email protected]> | 2022-08-06 23:51:35 +0200 |
|---|---|---|
| committer | Arthur LAURENT <[email protected]> | 2022-08-06 23:51:35 +0200 |
| commit | 2486a47e5997a5e3183e135a2ac86df4c83f5a30 (patch) | |
| tree | a164dd0682619c847b9dc16b21bcb4edd0b61c7b /xmake/rules/c++/modules/modules_support/msvc.lua | |
| parent | dfbb0c6a93a76a1777682a485be3791a7cd6bd5c (diff) | |
enable /stdifcsearchdir only if user ask for it
Diffstat (limited to 'xmake/rules/c++/modules/modules_support/msvc.lua')
| -rw-r--r-- | xmake/rules/c++/modules/modules_support/msvc.lua | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua index d0a5ec08b..af73f80af 100644 --- a/xmake/rules/c++/modules/modules_support/msvc.lua +++ b/xmake/rules/c++/modules/modules_support/msvc.lua @@ -69,17 +69,19 @@ function load(target) target:add("cxxflags", "@" .. mapper_file, {force = true, expand = false}) -- add stdifcdir in case of if the user want to use Microsoft modularised STL - local stdifcdirflag = get_stdifcdirflag(target) - for _, toolchain_inst in ipairs(target:toolchains()) do - if toolchain_inst:name() == "msvc" then - local vcvars = toolchain_inst:config("vcvars") - if vcvars.VCInstallDir and vcvars.VCToolsVersion then - local stdifcdir = path.join(vcvars.VCInstallDir, "Tools", "MSVC", vcvars.VCToolsVersion, "ifc", target:is_arch("x64") and "x64" or "x86") - if os.isdir(stdifcdir) then - target:add("cxxflags", {stdifcdirflag, winos.short_path(stdifcdir)}, {force = true, expand = false}) + if target:values("msvc.modules.stdifcdir") then + local stdifcdirflag = get_stdifcdirflag(target) + for _, toolchain_inst in ipairs(target:toolchains()) do + if toolchain_inst:name() == "msvc" then + local vcvars = toolchain_inst:config("vcvars") + if vcvars.VCInstallDir and vcvars.VCToolsVersion then + local stdifcdir = path.join(vcvars.VCInstallDir, "Tools", "MSVC", vcvars.VCToolsVersion, "ifc", target:is_arch("x64") and "x64" or "x86") + if os.isdir(stdifcdir) then + target:add("cxxflags", {stdifcdirflag, winos.short_path(stdifcdir)}, {force = true, expand = false}) + end end + break end - break end end |
