Merge topic 'support_ewdk_install'

071c0e3ce4 cmVSSetupHelper: Support Enterprise WDK build enviornment

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2658
This commit is contained in:
Brad King
2018-12-06 13:51:15 +00:00
committed by Kitware Robot
2 changed files with 34 additions and 0 deletions

View File

@@ -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;

View File

@@ -150,6 +150,7 @@ private:
HRESULT comInitialized;
// current best instance of VS selected
VSInstanceInfo chosenInstanceInfo;
bool IsEWDKEnabled();
std::string SpecifiedVSInstallLocation;
};