2017-01-28 04:49:09 +08:00
|
|
|
#include "pch.h"
|
2017-01-13 09:41:50 +08:00
|
|
|
#include "vcpkg_Commands.h"
|
|
|
|
#include "vcpkg_System.h"
|
2017-02-18 12:08:29 +08:00
|
|
|
#include "metrics.h"
|
|
|
|
|
2017-02-18 13:53:14 +08:00
|
|
|
#define STRINGIFY(...) #__VA_ARGS__
|
2017-02-18 12:08:29 +08:00
|
|
|
#define MACRO_TO_STRING(X) STRINGIFY(X)
|
|
|
|
|
2017-02-18 13:53:14 +08:00
|
|
|
#define VCPKG_VERSION_AS_STRING MACRO_TO_STRING(VCPKG_VERSION)
|
2017-01-13 09:41:50 +08:00
|
|
|
|
2017-01-13 14:03:57 +08:00
|
|
|
namespace vcpkg::Commands::Version
|
2017-01-13 09:41:50 +08:00
|
|
|
{
|
2017-02-18 12:08:29 +08:00
|
|
|
const std::string& version()
|
|
|
|
{
|
|
|
|
static const std::string s_version =
|
|
|
|
#include "../VERSION.txt"
|
|
|
|
|
|
|
|
+ std::string(VCPKG_VERSION_AS_STRING)
|
|
|
|
#ifndef NDEBUG
|
|
|
|
+ std::string("-debug")
|
|
|
|
#endif
|
2017-04-04 05:26:13 +08:00
|
|
|
+ std::string(Metrics::GetCompiledMetricsEnabled() ? "" : "-external");
|
2017-02-18 12:08:29 +08:00
|
|
|
return s_version;
|
|
|
|
}
|
|
|
|
|
2017-01-13 14:03:57 +08:00
|
|
|
void perform_and_exit(const vcpkg_cmd_arguments& args)
|
2017-01-13 09:41:50 +08:00
|
|
|
{
|
|
|
|
args.check_exact_arg_count(0);
|
2017-02-18 07:52:45 +08:00
|
|
|
args.check_and_get_optional_command_arguments({});
|
|
|
|
|
2017-01-13 09:41:50 +08:00
|
|
|
System::println("Vcpkg package management program version %s\n"
|
|
|
|
"\n"
|
2017-02-18 12:08:29 +08:00
|
|
|
"See LICENSE.txt for license information.", version()
|
2017-01-13 09:41:50 +08:00
|
|
|
);
|
2017-03-23 08:45:39 +08:00
|
|
|
Checks::exit_success(VCPKG_LINE_INFO);
|
2017-01-13 09:41:50 +08:00
|
|
|
}
|
|
|
|
}
|