diff options
| author | ruki <[email protected]> | 2022-12-17 12:35:53 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-17 12:35:53 +0800 |
| commit | 47f6392bd65c5a6803fdbe9714870928db5d7a1b (patch) | |
| tree | daa52b241ce81dd7dfeabd1ae1db11263487cea1 /tests/projects/c++/modules/test_msvc.lua | |
| parent | f6ce7c17992fa055b2d11260831f7c004784c319 (diff) | |
| parent | 1ba0ad7cbb139e04ebe29ea4fcede2fa57376433 (diff) | |
Merge pull request #3168 from Arthapz/cpp23-msvc-stdlib
add support of C++23 standard modules on msvc
Diffstat (limited to 'tests/projects/c++/modules/test_msvc.lua')
| -rw-r--r-- | tests/projects/c++/modules/test_msvc.lua | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/projects/c++/modules/test_msvc.lua b/tests/projects/c++/modules/test_msvc.lua index d51d3e3ef..a436b5814 100644 --- a/tests/projects/c++/modules/test_msvc.lua +++ b/tests/projects/c++/modules/test_msvc.lua @@ -1,5 +1,6 @@ import("lib.detect.find_tool") import("core.base.semver") +import("core.tool.toolchain") function _build() local ci = (os.getenv("CI") or os.getenv("GITHUB_ACTIONS") or ""):lower() @@ -12,7 +13,16 @@ end function main(t) if is_subhost("windows") then - os.exec("xmake f -c") - _build() + local msvc = toolchain.load("msvc") + if msvc and msvc:check() then + local vcvars = msvc:config("vcvars") + if vcvars and vcvars.VCInstallDir and vcvars.VCToolsVersion and semver.compare(vcvars.VCToolsVersion, "14.35") then + local stdmodulesdir = path.join(vcvars.VCInstallDir, "Tools", "MSVC", vcvars.VCToolsVersion, "modules") + if os.isdir(stdmodulesdir) then + os.exec("xmake f -c") + _build() + end + end + end end end |
