diff options
author | Jon Doron <arilou@gmail.com> | 2018-11-26 07:23:59 (GMT) |
---|---|---|
committer | Jon Doron <arilou@gmail.com> | 2018-11-27 05:13:26 (GMT) |
commit | 071c0e3ce42010ac62a22dfb62c7b6510506771b (patch) | |
tree | 95ffe2ca35e68f76822bfe5515ac38be5a09ac2f /Source | |
parent | 6786345210994063030ad82f7ece66a461bbfb76 (diff) | |
download | CMake-071c0e3ce42010ac62a22dfb62c7b6510506771b.zip CMake-071c0e3ce42010ac62a22dfb62c7b6510506771b.tar.gz CMake-071c0e3ce42010ac62a22dfb62c7b6510506771b.tar.bz2 |
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: Jon Doron <arilou@gmail.com>
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVSSetupHelper.cxx | 33 | ||||
-rw-r--r-- | Source/cmVSSetupHelper.h | 1 |
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; }; |