diff options
author | Brad King <brad.king@kitware.com> | 2023-09-08 23:11:41 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-09-09 11:21:11 (GMT) |
commit | cdcff0a0f0b67b19ebd0fb49c6d54a9bca71581e (patch) | |
tree | d3fc060584cb8c8301f14c3cf67f907a2401f2dc | |
parent | 1345928f9693a038153c43f09128bac0419d91ed (diff) | |
download | CMake-cdcff0a0f0b67b19ebd0fb49c6d54a9bca71581e.zip CMake-cdcff0a0f0b67b19ebd0fb49c6d54a9bca71581e.tar.gz CMake-cdcff0a0f0b67b19ebd0fb49c6d54a9bca71581e.tar.bz2 |
cmCMakeHostSystemInformationCommand: Clarify function names and roles
-rw-r--r-- | Source/cmCMakeHostSystemInformationCommand.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx index da680ca..e9fc72e 100644 --- a/Source/cmCMakeHostSystemInformationCommand.cxx +++ b/Source/cmCMakeHostSystemInformationCommand.cxx @@ -35,7 +35,6 @@ # include "cmGlobalVisualStudio10Generator.h" # include "cmGlobalVisualStudioVersionedGenerator.h" # include "cmVSSetupHelper.h" -# define HAVE_VS_SETUP_HELPER #endif namespace { @@ -378,9 +377,9 @@ std::map<std::string, std::string> GetOSReleaseVariables( return data; } -cm::optional<std::string> GetValue(cmExecutionStatus& status, - std::string const& key, - std::string const& variable) +cm::optional<std::string> GetDistribValue(cmExecutionStatus& status, + std::string const& key, + std::string const& variable) { const auto prefix = "DISTRIB_"_s; if (!cmHasPrefix(key, prefix)) { @@ -414,9 +413,9 @@ cm::optional<std::string> GetValue(cmExecutionStatus& status, return std::string{}; } -#ifdef HAVE_VS_SETUP_HELPER -cm::optional<std::string> GetValue(cmExecutionStatus& status, - std::string const& key) +#ifdef _WIN32 +cm::optional<std::string> GetWindowsValue(cmExecutionStatus& status, + std::string const& key) { auto* const gg = status.GetMakefile().GetGlobalGenerator(); for (auto vs : { 15, 16, 17 }) { @@ -598,9 +597,9 @@ bool cmCMakeHostSystemInformationCommand(std::vector<std::string> const& args, auto value = GetValueChained( [&]() { return GetValue(info, key); } - , [&]() { return GetValue(status, key, variable); } -#ifdef HAVE_VS_SETUP_HELPER - , [&]() { return GetValue(status, key); } + , [&]() { return GetDistribValue(status, key, variable); } +#ifdef _WIN32 + , [&]() { return GetWindowsValue(status, key); } #endif ); // clang-format on |