Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-12-31 12:57:39 +0300
committerJoyee Cheung <joyeec9h3@gmail.com>2019-01-06 05:44:57 +0300
commit6c0162149bc96de44e7596ebb8c668e46256279d (patch)
treeb04824e0f3c5a6ef99bf5c980a0eabef6a748045 /src/node_metadata.h
parentd18b0a01320e392e48f0c475effd8d4db2bb71a8 (diff)
src: move arch, platform and release into node_metadata.cc
Move definitions of more metadata into node_metadata{.h, .cc} so the data can be reused and easily inspected in C++. PR-URL: https://github.com/nodejs/node/pull/25293 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_metadata.h')
-rw-r--r--src/node_metadata.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/node_metadata.h b/src/node_metadata.h
index ef93c7b7e41..c6f379f085d 100644
--- a/src/node_metadata.h
+++ b/src/node_metadata.h
@@ -4,9 +4,22 @@
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
#include <string>
+#include "node_version.h"
namespace node {
+// if this is a release build and no explicit base has been set
+// substitute the standard release download URL
+#ifndef NODE_RELEASE_URLBASE
+#if NODE_VERSION_IS_RELEASE
+#define NODE_RELEASE_URLBASE "https://nodejs.org/download/release/"
+#endif // NODE_VERSION_IS_RELEASE
+#endif // NODE_RELEASE_URLBASE
+
+#if defined(NODE_RELEASE_URLBASE)
+#define NODE_HAS_RELEASE_URLS
+#endif
+
#define NODE_VERSIONS_KEYS_BASE(V) \
V(node) \
V(v8) \
@@ -43,7 +56,7 @@ namespace node {
class Metadata {
public:
- Metadata() = default;
+ Metadata();
Metadata(Metadata&) = delete;
Metadata(Metadata&&) = delete;
Metadata operator=(Metadata&) = delete;
@@ -63,7 +76,27 @@ class Metadata {
#undef V
};
+ struct Release {
+ Release();
+
+ std::string name;
+#if NODE_VERSION_IS_LTS
+ std::string lts;
+#endif // NODE_VERSION_IS_LTS
+
+#ifdef NODE_HAS_RELEASE_URLS
+ std::string source_url;
+ std::string headers_url;
+#ifdef _WIN32
+ std::string lib_url;
+#endif // _WIN32
+#endif // NODE_HAS_RELEASE_URLS
+ };
+
Versions versions;
+ const Release release;
+ const std::string arch;
+ const std::string platform;
};
// Per-process global