OLD | NEW |
1 # Copyright 2014 the V8 project authors. All rights reserved. | 1 # Copyright 2014 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 { | 5 { |
6 'variables': { | 6 'variables': { |
7 'v8_code': 1, | 7 'v8_code': 1, |
8 }, | 8 }, |
9 'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'], | 9 'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'], |
10 'targets': [ | 10 'targets': [ |
11 { | 11 { |
12 'target_name': 'base', | |
13 'type': 'static_library', | |
14 'variables': { | |
15 'optimize': 'max', | |
16 }, | |
17 'include_dirs+': [ | |
18 '../..', | |
19 ], | |
20 'sources': [ | |
21 'atomicops.h', | |
22 'atomicops_internals_arm64_gcc.h', | |
23 'atomicops_internals_arm_gcc.h', | |
24 'atomicops_internals_atomicword_compat.h', | |
25 'atomicops_internals_mac.h', | |
26 'atomicops_internals_mips_gcc.h', | |
27 'atomicops_internals_tsan.h', | |
28 'atomicops_internals_x86_gcc.cc', | |
29 'atomicops_internals_x86_gcc.h', | |
30 'atomicops_internals_x86_msvc.h', | |
31 'bits.h', | |
32 'build_config.h', | |
33 'cpu.cc', | |
34 'cpu.h', | |
35 'flags.h', | |
36 'lazy-instance.h', | |
37 'logging.cc', | |
38 'logging.h', | |
39 'macros.h', | |
40 'once.cc', | |
41 'once.h', | |
42 'platform/elapsed-timer.h', | |
43 'platform/time.cc', | |
44 'platform/time.h', | |
45 'platform/condition-variable.cc', | |
46 'platform/condition-variable.h', | |
47 'platform/mutex.cc', | |
48 'platform/mutex.h', | |
49 'platform/platform.h', | |
50 'platform/semaphore.cc', | |
51 'platform/semaphore.h', | |
52 'safe_conversions.h', | |
53 'safe_conversions_impl.h', | |
54 'safe_math.h', | |
55 'safe_math_impl.h', | |
56 'sys-info.cc', | |
57 'sys-info.h', | |
58 'utils/random-number-generator.cc', | |
59 'utils/random-number-generator.h', | |
60 ], | |
61 'conditions': [ | |
62 ['want_separate_host_toolset==1', { | |
63 'toolsets': ['host', 'target'], | |
64 }, { | |
65 'toolsets': ['target'], | |
66 }], | |
67 ['OS=="linux"', { | |
68 'link_settings': { | |
69 'libraries': [ | |
70 '-lrt' | |
71 ] | |
72 }, | |
73 'sources': [ | |
74 'platform/platform-linux.cc', | |
75 'platform/platform-posix.cc' | |
76 ], | |
77 } | |
78 ], | |
79 ['OS=="android"', { | |
80 'sources': [ | |
81 'platform/platform-posix.cc' | |
82 ], | |
83 'conditions': [ | |
84 ['host_os=="mac"', { | |
85 'target_conditions': [ | |
86 ['_toolset=="host"', { | |
87 'sources': [ | |
88 'platform/platform-macos.cc' | |
89 ] | |
90 }, { | |
91 'sources': [ | |
92 'platform/platform-linux.cc' | |
93 ] | |
94 }], | |
95 ], | |
96 }, { | |
97 # TODO(bmeurer): What we really want here, is this: | |
98 # | |
99 # 'link_settings': { | |
100 # 'target_conditions': [ | |
101 # ['_toolset=="host"', { | |
102 # 'libraries': [ | |
103 # '-lrt' | |
104 # ] | |
105 # }] | |
106 # ] | |
107 # }, | |
108 # | |
109 # but we can't do this right now, as the AOSP does not support | |
110 # linking against the host librt, so we need to work around this | |
111 # for now, using the following hack (see platform/time.cc): | |
112 'target_conditions': [ | |
113 ['_toolset=="host"', { | |
114 'defines': [ | |
115 'V8_LIBRT_NOT_AVAILABLE=1', | |
116 ], | |
117 }], | |
118 ], | |
119 'sources': [ | |
120 'platform/platform-linux.cc' | |
121 ] | |
122 }], | |
123 ], | |
124 }, | |
125 ], | |
126 ['OS=="qnx"', { | |
127 'link_settings': { | |
128 'target_conditions': [ | |
129 ['_toolset=="host" and host_os=="linux"', { | |
130 'libraries': [ | |
131 '-lrt' | |
132 ], | |
133 }], | |
134 ['_toolset=="target"', { | |
135 'libraries': [ | |
136 '-lbacktrace' | |
137 ], | |
138 }], | |
139 ], | |
140 }, | |
141 'sources': [ | |
142 'platform/platform-posix.cc', | |
143 'qnx-math.h', | |
144 ], | |
145 'target_conditions': [ | |
146 ['_toolset=="host" and host_os=="linux"', { | |
147 'sources': [ | |
148 'platform/platform-linux.cc' | |
149 ], | |
150 }], | |
151 ['_toolset=="host" and host_os=="mac"', { | |
152 'sources': [ | |
153 'platform/platform-macos.cc' | |
154 ], | |
155 }], | |
156 ['_toolset=="target"', { | |
157 'sources': [ | |
158 'platform/platform-qnx.cc' | |
159 ], | |
160 }], | |
161 ], | |
162 }, | |
163 ], | |
164 ['OS=="freebsd"', { | |
165 'link_settings': { | |
166 'libraries': [ | |
167 '-L/usr/local/lib -lexecinfo', | |
168 ]}, | |
169 'sources': [ | |
170 'platform/platform-freebsd.cc', | |
171 'platform/platform-posix.cc' | |
172 ], | |
173 } | |
174 ], | |
175 ['OS=="openbsd"', { | |
176 'link_settings': { | |
177 'libraries': [ | |
178 '-L/usr/local/lib -lexecinfo', | |
179 ]}, | |
180 'sources': [ | |
181 'platform/platform-openbsd.cc', | |
182 'platform/platform-posix.cc' | |
183 ], | |
184 } | |
185 ], | |
186 ['OS=="netbsd"', { | |
187 'link_settings': { | |
188 'libraries': [ | |
189 '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo', | |
190 ]}, | |
191 'sources': [ | |
192 'platform/platform-openbsd.cc', | |
193 'platform/platform-posix.cc' | |
194 ], | |
195 } | |
196 ], | |
197 ['OS=="solaris"', { | |
198 'link_settings': { | |
199 'libraries': [ | |
200 '-lnsl', | |
201 ]}, | |
202 'sources': [ | |
203 'platform/platform-solaris.cc', | |
204 'platform/platform-posix.cc' | |
205 ], | |
206 } | |
207 ], | |
208 ['OS=="mac"', { | |
209 'sources': [ | |
210 'platform/platform-macos.cc', | |
211 'platform/platform-posix.cc' | |
212 ]}, | |
213 ], | |
214 ['OS=="win"', { | |
215 'defines': [ | |
216 '_CRT_RAND_S' # for rand_s() | |
217 ], | |
218 'variables': { | |
219 'gyp_generators': '<!(echo $GYP_GENERATORS)', | |
220 }, | |
221 'conditions': [ | |
222 ['gyp_generators=="make"', { | |
223 'variables': { | |
224 'build_env': '<!(uname -o)', | |
225 }, | |
226 'conditions': [ | |
227 ['build_env=="Cygwin"', { | |
228 'sources': [ | |
229 'platform/platform-cygwin.cc', | |
230 'platform/platform-posix.cc' | |
231 ], | |
232 }, { | |
233 'sources': [ | |
234 'platform/platform-win32.cc', | |
235 'win32-headers.h', | |
236 'win32-math.cc', | |
237 'win32-math.h' | |
238 ], | |
239 }], | |
240 ], | |
241 'link_settings': { | |
242 'libraries': [ '-lwinmm', '-lws2_32' ], | |
243 }, | |
244 }, { | |
245 'sources': [ | |
246 'platform/platform-win32.cc', | |
247 'win32-headers.h', | |
248 'win32-math.cc', | |
249 'win32-math.h' | |
250 ], | |
251 'msvs_disabled_warnings': [4351, 4355, 4800], | |
252 'link_settings': { | |
253 'libraries': [ '-lwinmm.lib', '-lws2_32.lib' ], | |
254 }, | |
255 }], | |
256 ], | |
257 }], | |
258 ], | |
259 }, | |
260 { | |
261 'target_name': 'base-unittests', | 12 'target_name': 'base-unittests', |
262 'type': 'executable', | 13 'type': 'executable', |
263 'dependencies': [ | 14 'dependencies': [ |
264 '../../testing/gtest.gyp:gtest', | 15 '../../testing/gtest.gyp:gtest', |
265 '../../testing/gtest.gyp:gtest_main', | 16 '../../testing/gtest.gyp:gtest_main', |
266 'base', | 17 '../../tools/gyp/v8.gyp:v8_libbase', |
267 ], | 18 ], |
268 'include_dirs': [ | 19 'include_dirs': [ |
269 '../..', | 20 '../..', |
270 ], | 21 ], |
271 'sources': [ ### gcmole(all) ### | 22 'sources': [ ### gcmole(all) ### |
272 'bits-unittest.cc', | 23 'bits-unittest.cc', |
273 'cpu-unittest.cc', | 24 'cpu-unittest.cc', |
274 'flags-unittest.cc', | 25 'flags-unittest.cc', |
275 'platform/condition-variable-unittest.cc', | 26 'platform/condition-variable-unittest.cc', |
276 'platform/mutex-unittest.cc', | 27 'platform/mutex-unittest.cc', |
277 'platform/platform-unittest.cc', | 28 'platform/platform-unittest.cc', |
278 'platform/semaphore-unittest.cc', | 29 'platform/semaphore-unittest.cc', |
279 'platform/time-unittest.cc', | 30 'platform/time-unittest.cc', |
280 'sys-info-unittest.cc', | 31 'sys-info-unittest.cc', |
281 'utils/random-number-generator-unittest.cc', | 32 'utils/random-number-generator-unittest.cc', |
282 ], | 33 ], |
283 'conditions': [ | 34 'conditions': [ |
284 ['os_posix == 1', { | 35 ['os_posix == 1', { |
285 # TODO(svenpanne): This is a temporary work-around to fix the warnings | 36 # TODO(svenpanne): This is a temporary work-around to fix the warnings |
286 # that show up because we use -std=gnu++0x instead of -std=c++11. | 37 # that show up because we use -std=gnu++0x instead of -std=c++11. |
287 'cflags!': [ | 38 'cflags!': [ |
288 '-pedantic', | 39 '-pedantic', |
289 ], | 40 ], |
290 }], | 41 }], |
291 ], | 42 ], |
292 }, | 43 }, |
293 ], | 44 ], |
294 } | 45 } |
OLD | NEW |