aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg_info.cpp
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-11-07 17:31:41 -0800
committerAlexander Karatarakis <alkarata@microsoft.com>2016-11-07 17:31:41 -0800
commitc91d8e41b60653b652b11c641f7a5b3d3eab7f6b (patch)
tree6e81f76a7f1067bab8efdbb38e7b25338499f87f /toolsrc/src/vcpkg_info.cpp
parent7a1bc07142577cce32ee88c8d8ef60b386d19b6a (diff)
downloadvcpkg-c91d8e41b60653b652b11c641f7a5b3d3eab7f6b.tar.gz
vcpkg-c91d8e41b60653b652b11c641f7a5b3d3eab7f6b.zip
Introduce vcpkg_info.h/cpp
Diffstat (limited to 'toolsrc/src/vcpkg_info.cpp')
-rw-r--r--toolsrc/src/vcpkg_info.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg_info.cpp b/toolsrc/src/vcpkg_info.cpp
new file mode 100644
index 000000000..25c09d6da
--- /dev/null
+++ b/toolsrc/src/vcpkg_info.cpp
@@ -0,0 +1,34 @@
+#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 { namespace Info
+{
+ 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;
+ }
+
+ const std::string& email()
+ {
+ static const std::string s_email = R"(vcpkg@microsoft.com)";
+ return s_email;
+ }
+}}