diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-17 20:08:29 -0800 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-02-17 20:08:29 -0800 |
| commit | ac2ec94129ae0bdbcb16c0c2333fbfc52844d6c6 (patch) | |
| tree | 75c2ea10139fe56248c2d822effd904a9ff42c4f /toolsrc/src/commands_version.cpp | |
| parent | 7ae6c2152686467ab81663e6d7d259f475c0229d (diff) | |
| download | vcpkg-ac2ec94129ae0bdbcb16c0c2333fbfc52844d6c6.tar.gz vcpkg-ac2ec94129ae0bdbcb16c0c2333fbfc52844d6c6.zip | |
Change Info::version() to Version::version()
Diffstat (limited to 'toolsrc/src/commands_version.cpp')
| -rw-r--r-- | toolsrc/src/commands_version.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/toolsrc/src/commands_version.cpp b/toolsrc/src/commands_version.cpp index 3dd90e630..462c31c90 100644 --- a/toolsrc/src/commands_version.cpp +++ b/toolsrc/src/commands_version.cpp @@ -1,10 +1,33 @@ #include "pch.h" #include "vcpkg_Commands.h" #include "vcpkg_System.h" -#include "vcpkg_info.h" +#include "metrics.h" + +#define STRINGIFY(X) #X +#define MACRO_TO_STRING(X) STRINGIFY(X) + +#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)"" // Double quotes needed at the end to prevent blank token namespace vcpkg::Commands::Version { + const std::string& version() + { + static const std::string s_version = +#include "../VERSION.txt" + + +#pragma warning( push ) +#pragma warning( disable : 4003) + // VCPKG_VERSION can be defined but have no value, which yields C4003. + + std::string(VCPKG_VERSION_AS_STRING) +#pragma warning( pop ) +#ifndef NDEBUG + + std::string("-debug") +#endif + + std::string(GetCompiledMetricsEnabled() ? "" : "-external"); + return s_version; + } + void perform_and_exit(const vcpkg_cmd_arguments& args) { args.check_exact_arg_count(0); @@ -12,7 +35,7 @@ namespace vcpkg::Commands::Version System::println("Vcpkg package management program version %s\n" "\n" - "See LICENSE.txt for license information.", Info::version() + "See LICENSE.txt for license information.", version() ); exit(EXIT_SUCCESS); } |
