Pull define for version out into v8-version-string.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-Original-Commit-Position: refs/heads/master@{#42243}
Committed: 4593845417
Review-Url: https://codereview.chromium.org/2621983002
Cr-Commit-Position: refs/heads/master@{#42289}
This commit is contained in:
parent
022635bf0d
commit
ffc0931f87
13
BUILD.gn
13
BUILD.gn
@ -851,6 +851,17 @@ 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-string.h",
|
||||
"include/v8-version.h",
|
||||
]
|
||||
}
|
||||
|
||||
v8_source_set("v8_base") {
|
||||
visibility = [ ":*" ] # Only targets in this file can depend on this.
|
||||
|
||||
@ -864,7 +875,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 +2199,7 @@ v8_source_set("v8_base") {
|
||||
deps = [
|
||||
":v8_libbase",
|
||||
":v8_libsampler",
|
||||
":v8_version",
|
||||
]
|
||||
|
||||
sources += [ v8_generated_peephole_source ]
|
||||
|
33
include/v8-version-string.h
Normal file
33
include/v8-version-string.h
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef V8_VERSION_STRING_H_
|
||||
#define V8_VERSION_STRING_H_
|
||||
|
||||
#include "include/v8-version.h"
|
||||
|
||||
// This is here rather than v8-version.h to keep that file simple and
|
||||
// machine-processable.
|
||||
|
||||
#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) "." 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_VERSION_STRING_H_
|
@ -397,6 +397,7 @@
|
||||
'../include/v8-profiler.h',
|
||||
'../include/v8-testing.h',
|
||||
'../include/v8-util.h',
|
||||
'../include/v8-version-string.h',
|
||||
'../include/v8-version.h',
|
||||
'../include/v8.h',
|
||||
'../include/v8config.h',
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "src/version.h"
|
||||
|
||||
#include "include/v8-version-string.h"
|
||||
#include "include/v8-version.h"
|
||||
#include "src/utils.h"
|
||||
|
||||
@ -12,25 +13,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 +22,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user