summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmVSSetupHelper.cxx33
-rw-r--r--Source/cmVSSetupHelper.h1
2 files changed, 34 insertions, 0 deletions
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index 22fe007..7a54e12 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -267,6 +267,19 @@ bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion)
return isInstalled && !vsToolsetVersion.empty();
}
+bool cmVSSetupAPIHelper::IsEWDKEnabled()
+{
+ std::string envEnterpriseWDK, envDisableRegistryUse;
+ cmSystemTools::GetEnv("EnterpriseWDK", envEnterpriseWDK);
+ cmSystemTools::GetEnv("DisableRegistryUse", envDisableRegistryUse);
+ if (!cmSystemTools::Strucmp(envEnterpriseWDK.c_str(), "True") &&
+ !cmSystemTools::Strucmp(envDisableRegistryUse.c_str(), "True")) {
+ return true;
+ }
+
+ return false;
+}
+
bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
{
bool isVSInstanceExists = false;
@@ -274,6 +287,26 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
return true;
}
+ if (this->IsEWDKEnabled()) {
+ std::string envWindowsSdkDir81, envVSVersion, envVsInstallDir;
+
+ cmSystemTools::GetEnv("WindowsSdkDir_81", envWindowsSdkDir81);
+ cmSystemTools::GetEnv("VisualStudioVersion", envVSVersion);
+ cmSystemTools::GetEnv("VSINSTALLDIR", envVsInstallDir);
+ if (envVSVersion.empty() || envVsInstallDir.empty())
+ return false;
+
+ chosenInstanceInfo.VSInstallLocation =
+ std::wstring(envVsInstallDir.begin(), envVsInstallDir.end());
+ chosenInstanceInfo.Version =
+ std::wstring(envVSVersion.begin(), envVSVersion.end());
+ chosenInstanceInfo.VCToolsetVersion = envVSVersion;
+ chosenInstanceInfo.ullVersion = std::stoi(envVSVersion);
+ chosenInstanceInfo.IsWin10SDKInstalled = true;
+ chosenInstanceInfo.IsWin81SDKInstalled = !envWindowsSdkDir81.empty();
+ return true;
+ }
+
if (initializationFailure || setupConfig == NULL || setupConfig2 == NULL ||
setupHelper == NULL)
return false;
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index 4144c15..b9cca45 100644
--- a/Source/cmVSSetupHelper.h
+++ b/Source/cmVSSetupHelper.h
@@ -150,6 +150,7 @@ private:
HRESULT comInitialized;
// current best instance of VS selected
VSInstanceInfo chosenInstanceInfo;
+ bool IsEWDKEnabled();
std::string SpecifiedVSInstallLocation;
};