diff --git a/BUILD.gn b/BUILD.gn index e524a5c803..0daea44e82 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -851,16 +851,6 @@ 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. @@ -874,6 +864,7 @@ 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", @@ -2198,7 +2189,6 @@ v8_source_set("v8_base") { deps = [ ":v8_libbase", ":v8_libsampler", - ":v8_version", ] sources += [ v8_generated_peephole_source ] diff --git a/include/v8-version.h b/include/v8-version.h index e963b34d07..a7a9a2f7bd 100644 --- a/include/v8-version.h +++ b/include/v8-version.h @@ -17,24 +17,4 @@ // (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_ diff --git a/src/version.cc b/src/version.cc index 67535cbe6d..7305bf2576 100644 --- a/src/version.cc +++ b/src/version.cc @@ -12,6 +12,25 @@ // 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 { @@ -21,7 +40,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_ = V8_VERSION_STRING; +const char* Version::version_string_ = VERSION_STRING; // Calculate the V8 version string. void Version::GetString(Vector str) {