Commit 45938454 authored by scottmg's avatar scottmg Committed by Commit bot

Pull define for version out into v8-version.h and separate build target

This is part of removing the dependency of the Chromium browser DLL on
Windows on V8.

R=jochen@chromium.org
BUG=chromium:581766

Review-Url: https://codereview.chromium.org/2621983002
Cr-Commit-Position: refs/heads/master@{#42243}
parent a2efde46
......@@ -851,6 +851,16 @@ if (v8_use_external_startup_data) {
}
}
# This is split out to be a non-code containing target that the Chromium browser
# DLL can depend upon to get only a version string.
v8_source_set("v8_version") {
configs = [ ":internal_config" ]
sources = [
"include/v8-version.h",
]
}
v8_source_set("v8_base") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
......@@ -864,7 +874,6 @@ v8_source_set("v8_base") {
"include/v8-profiler.h",
"include/v8-testing.h",
"include/v8-util.h",
"include/v8-version.h",
"include/v8.h",
"include/v8config.h",
"src/accessors.cc",
......@@ -2189,6 +2198,7 @@ v8_source_set("v8_base") {
deps = [
":v8_libbase",
":v8_libsampler",
":v8_version",
]
sources += [ v8_generated_peephole_source ]
......
......@@ -17,4 +17,24 @@
// (Boolean macro values are not supported by all preprocessors.)
#define V8_IS_CANDIDATE_VERSION 1
#if V8_IS_CANDIDATE_VERSION
#define V8_CANDIDATE_STRING " (candidate)"
#else
#define V8_CANDIDATE_STRING ""
#endif
#define V8_SX(x) #x
#define V8_S(x) V8_SX(x)
#if V8_PATCH_LEVEL > 0
#define V8_VERSION_STRING \
V8_S(V8_MAJOR_VERSION) \
"." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) "." V8_S( \
V8_PATCH_LEVEL) V8_CANDIDATE_STRING
#else
#define V8_VERSION_STRING \
V8_S(V8_MAJOR_VERSION) \
"." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) V8_CANDIDATE_STRING
#endif
#endif // V8_INCLUDE_VERSION_H_
......@@ -12,25 +12,6 @@
// number. This define is mainly used by the build system script.
#define SONAME ""
#if V8_IS_CANDIDATE_VERSION
#define CANDIDATE_STRING " (candidate)"
#else
#define CANDIDATE_STRING ""
#endif
#define SX(x) #x
#define S(x) SX(x)
#if V8_PATCH_LEVEL > 0
#define VERSION_STRING \
S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S( \
V8_PATCH_LEVEL) CANDIDATE_STRING
#else
#define VERSION_STRING \
S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \
CANDIDATE_STRING
#endif
namespace v8 {
namespace internal {
......@@ -40,7 +21,7 @@ int Version::build_ = V8_BUILD_NUMBER;
int Version::patch_ = V8_PATCH_LEVEL;
bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0);
const char* Version::soname_ = SONAME;
const char* Version::version_string_ = VERSION_STRING;
const char* Version::version_string_ = V8_VERSION_STRING;
// Calculate the V8 version string.
void Version::GetString(Vector<char> str) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment