From 8b4e9f90ba045edb14cb2800c506ee6bc5118cd7 Mon Sep 17 00:00:00 2001 From: Arthur LAURENT Date: Wed, 21 May 2025 01:37:17 +0200 Subject: (C++ modules support) refactor tests --- xmake/rules/c++/modules/msvc/support.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'xmake/rules/c++/modules/msvc/support.lua') diff --git a/xmake/rules/c++/modules/msvc/support.lua b/xmake/rules/c++/modules/msvc/support.lua index 41c5cd44e..c425ce911 100644 --- a/xmake/rules/c++/modules/msvc/support.lua +++ b/xmake/rules/c++/modules/msvc/support.lua @@ -46,11 +46,13 @@ function load(target) local msvc = target:toolchain("msvc") if msvc then local vcvars = msvc:config("vcvars") - if vcvars.VCInstallDir and vcvars.VCToolsVersion and semver.compare(vcvars.VCToolsVersion, "14.35") > 0 then + if vcvars.VCInstallDir and vcvars.VCToolsVersion and semver.compare(vcvars.VCToolsVersion, "14.35") >= 0 then stdmodulesdir = path.join(vcvars.VCInstallDir, "Tools", "MSVC", vcvars.VCToolsVersion, "modules") end end - target:data_set("c++.msvc.enable_std_import", isatleastcpp23 and os.isdir(stdmodulesdir)) + if stdmodulesdir then + target:data_set("c++.msvc.enable_std_import", isatleastcpp23 and os.isdir(stdmodulesdir)) + end end end -- cgit v1.3.1