Commit 071c0e3c authored by arilou's avatar arilou
Browse files

cmVSSetupHelper: Support Enterprise WDK build enviornment

Enterprise WDK is a command line build enviornment that does not require
any installation prior to use.

More information and download can be found here:
https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/using-the-enterprise-wdk

Signed-off-by: arilou's avatarJon Doron <arilou@gmail.com>
parent 67863452
......@@ -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;
......
......@@ -150,6 +150,7 @@ private:
HRESULT comInitialized;
// current best instance of VS selected
VSInstanceInfo chosenInstanceInfo;
bool IsEWDKEnabled();
std::string SpecifiedVSInstallLocation;
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment