Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: src/version.cc

Issue 2621983002: Pull define for version out into v8-version-string.h and separate build target (Closed)
Patch Set: forgotten removal Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/v8.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/version.h" 5 #include "src/version.h"
6 6
7 #include "include/v8-version-string.h"
7 #include "include/v8-version.h" 8 #include "include/v8-version.h"
8 #include "src/utils.h" 9 #include "src/utils.h"
9 10
10 // Define SONAME to have the build system put a specific SONAME into the 11 // Define SONAME to have the build system put a specific SONAME into the
11 // shared library instead the generic SONAME generated from the V8 version 12 // shared library instead the generic SONAME generated from the V8 version
12 // number. This define is mainly used by the build system script. 13 // number. This define is mainly used by the build system script.
13 #define SONAME "" 14 #define SONAME ""
14 15
15 #if V8_IS_CANDIDATE_VERSION
16 #define CANDIDATE_STRING " (candidate)"
17 #else
18 #define CANDIDATE_STRING ""
19 #endif
20
21 #define SX(x) #x
22 #define S(x) SX(x)
23
24 #if V8_PATCH_LEVEL > 0
25 #define VERSION_STRING \
26 S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) "." S( \
27 V8_PATCH_LEVEL) CANDIDATE_STRING
28 #else
29 #define VERSION_STRING \
30 S(V8_MAJOR_VERSION) "." S(V8_MINOR_VERSION) "." S(V8_BUILD_NUMBER) \
31 CANDIDATE_STRING
32 #endif
33
34 namespace v8 { 16 namespace v8 {
35 namespace internal { 17 namespace internal {
36 18
37 int Version::major_ = V8_MAJOR_VERSION; 19 int Version::major_ = V8_MAJOR_VERSION;
38 int Version::minor_ = V8_MINOR_VERSION; 20 int Version::minor_ = V8_MINOR_VERSION;
39 int Version::build_ = V8_BUILD_NUMBER; 21 int Version::build_ = V8_BUILD_NUMBER;
40 int Version::patch_ = V8_PATCH_LEVEL; 22 int Version::patch_ = V8_PATCH_LEVEL;
41 bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0); 23 bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0);
42 const char* Version::soname_ = SONAME; 24 const char* Version::soname_ = SONAME;
43 const char* Version::version_string_ = VERSION_STRING; 25 const char* Version::version_string_ = V8_VERSION_STRING;
44 26
45 // Calculate the V8 version string. 27 // Calculate the V8 version string.
46 void Version::GetString(Vector<char> str) { 28 void Version::GetString(Vector<char> str) {
47 const char* candidate = IsCandidate() ? " (candidate)" : ""; 29 const char* candidate = IsCandidate() ? " (candidate)" : "";
48 #ifdef USE_SIMULATOR 30 #ifdef USE_SIMULATOR
49 const char* is_simulator = " SIMULATOR"; 31 const char* is_simulator = " SIMULATOR";
50 #else 32 #else
51 const char* is_simulator = ""; 33 const char* is_simulator = "";
52 #endif // USE_SIMULATOR 34 #endif // USE_SIMULATOR
53 if (GetPatch() > 0) { 35 if (GetPatch() > 0) {
(...skipping 21 matching lines...) Expand all
75 GetMajor(), GetMinor(), GetBuild(), candidate); 57 GetMajor(), GetMinor(), GetBuild(), candidate);
76 } 58 }
77 } else { 59 } else {
78 // Use specific SONAME. 60 // Use specific SONAME.
79 SNPrintF(str, "%s", soname_); 61 SNPrintF(str, "%s", soname_);
80 } 62 }
81 } 63 }
82 64
83 } // namespace internal 65 } // namespace internal
84 } // namespace v8 66 } // namespace v8
OLDNEW
« no previous file with comments | « src/v8.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698