summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudioVersionedGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-10 19:48:27 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-17 15:59:24 (GMT)
commit406a103318ee58774ae7afd25d6746a5629f956a (patch)
treec3e0f968aa86a9274babd189662cb58ce3334c06 /Source/cmGlobalVisualStudioVersionedGenerator.cxx
parentd9641980d2a223e0a6fe42ff23499e55f49fd6d5 (diff)
downloadCMake-406a103318ee58774ae7afd25d6746a5629f956a.zip
CMake-406a103318ee58774ae7afd25d6746a5629f956a.tar.gz
CMake-406a103318ee58774ae7afd25d6746a5629f956a.tar.bz2
VS: Add support for C++ module internal partitions in VS 17.6 and newer
VS 17.6 now implements `ScanSourceforModuleDependencies` using the same `cl /scanDependencies` scanner that our Ninja generator uses. It can distinguish module internal partitions from module interface units based on their content. Switch from `CompileAsCppModule` to `CompileAsCpp` for `CXX_MODULES` sources so that MSBuild can scan and classify them.
Diffstat (limited to 'Source/cmGlobalVisualStudioVersionedGenerator.cxx')
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index f28419a..602b42f 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -739,6 +739,22 @@ bool cmGlobalVisualStudioVersionedGenerator::IsUtf8EncodingSupported() const
cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer16_10_P2));
}
+bool cmGlobalVisualStudioVersionedGenerator::IsScanDependenciesSupported()
+ const
+{
+ // Supported from Visual Studio 17.6 Preview 7.
+ if (this->Version > cmGlobalVisualStudioGenerator::VSVersion::VS17) {
+ return true;
+ }
+ if (this->Version < cmGlobalVisualStudioGenerator::VSVersion::VS17) {
+ return false;
+ }
+ static std::string const vsVer17_6_P7 = "17.6.33706.43";
+ cm::optional<std::string> vsVer = this->GetVSInstanceVersion();
+ return (vsVer &&
+ cmSystemTools::VersionCompareGreaterEq(*vsVer, vsVer17_6_P7));
+}
+
const char*
cmGlobalVisualStudioVersionedGenerator::GetAndroidApplicationTypeRevision()
const