v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
version.cc
Go to the documentation of this file.
1// Copyright 2012 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "src/utils/version.h"
6
9#include "src/base/strings.h"
10
11// Define SONAME to have the build system put a specific SONAME into the
12// shared library instead the generic SONAME generated from the V8 version
13// number. This define is mainly used by the build system script.
14#define SONAME ""
15
16namespace v8 {
17namespace internal {
18
25const char* Version::soname_ = SONAME;
27
28// Calculate the V8 version string.
30 const char* candidate = IsCandidate() ? " (candidate)" : "";
31 if (GetPatch() > 0) {
32 base::SNPrintF(str, "%d.%d.%d.%d%s%s", GetMajor(), GetMinor(), GetBuild(),
33 GetPatch(), GetEmbedder(), candidate);
34 } else {
35 base::SNPrintF(str, "%d.%d.%d%s%s", GetMajor(), GetMinor(), GetBuild(),
36 GetEmbedder(), candidate);
37 }
38}
39
40// Calculate the SONAME for the V8 shared library.
42 if (soname_ == nullptr || *soname_ == '\0') {
43 // Generate generic SONAME if no specific SONAME is defined.
44 const char* candidate = IsCandidate() ? "-candidate" : "";
45 if (GetPatch() > 0) {
46 SNPrintF(str, "libv8-%d.%d.%d.%d%s%s.so", GetMajor(), GetMinor(),
47 GetBuild(), GetPatch(), GetEmbedder(), candidate);
48 } else {
49 SNPrintF(str, "libv8-%d.%d.%d%s%s.so", GetMajor(), GetMinor(), GetBuild(),
50 GetEmbedder(), candidate);
51 }
52 } else {
53 // Use specific SONAME.
54 SNPrintF(str, "%s", soname_);
55 }
56}
57
58#undef SONAME
59
60} // namespace internal
61} // namespace v8
static int build_
Definition version.h:47
static const char * GetEmbedder()
Definition version.h:28
static int GetMajor()
Definition version.h:24
static int GetBuild()
Definition version.h:26
static int GetPatch()
Definition version.h:27
static int GetMinor()
Definition version.h:25
static void GetSONAME(base::Vector< char > str)
Definition version.cc:41
static bool candidate_
Definition version.h:50
static const char * version_string_
Definition version.h:52
static const char * soname_
Definition version.h:51
static void GetString(base::Vector< char > str)
Definition version.cc:29
static const char * embedder_
Definition version.h:49
static int minor_
Definition version.h:46
static int patch_
Definition version.h:48
static bool IsCandidate()
Definition version.h:29
static int major_
Definition version.h:45
int SNPrintF(Vector< char > str, const char *format,...)
Definition strings.cc:20
#define V8_VERSION_STRING
#define V8_EMBEDDER_STRING
#define V8_MAJOR_VERSION
Definition v8-version.h:11
#define V8_PATCH_LEVEL
Definition v8-version.h:14
#define V8_BUILD_NUMBER
Definition v8-version.h:13
#define V8_IS_CANDIDATE_VERSION
Definition v8-version.h:18
#define V8_MINOR_VERSION
Definition v8-version.h:12
#define SONAME
Definition version.cc:14