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

Side by Side Diff: build/common.gypi

Issue 7740020: Refactor .gyp files: (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « Makefile ('k') | build/gyp_v8 » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2011 the V8 project authors. All rights reserved. 1 # Copyright 2011 the V8 project authors. All rights reserved.
2 # Redistribution and use in source and binary forms, with or without 2 # Redistribution and use in source and binary forms, with or without
3 # modification, are permitted provided that the following conditions are 3 # modification, are permitted provided that the following conditions are
4 # met: 4 # met:
5 # 5 #
6 # * Redistributions of source code must retain the above copyright 6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer. 7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above 8 # * Redistributions in binary form must reproduce the above
9 # copyright notice, this list of conditions and the following 9 # copyright notice, this list of conditions and the following
10 # disclaimer in the documentation and/or other materials provided 10 # disclaimer in the documentation and/or other materials provided
11 # with the distribution. 11 # with the distribution.
12 # * Neither the name of Google Inc. nor the names of its 12 # * Neither the name of Google Inc. nor the names of its
13 # contributors may be used to endorse or promote products derived 13 # contributors may be used to endorse or promote products derived
14 # from this software without specific prior written permission. 14 # from this software without specific prior written permission.
15 # 15 #
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 # Shared definitions for all V8-related targets.
29
28 { 30 {
29 'variables': { 31 'variables': {
30 'library%': 'static_library', 32 'use_system_v8%': 0,
31 'component%': 'static_library', 33 'msvs_use_common_release': 0,
32 'visibility%': 'hidden', 34 'gcc_version%': 'unknown',
33 'msvs_multi_core_compile%': '1', 35 'v8_compress_startup_data%': 'off',
34 'variables': { 36 'v8_target_arch%': '<(target_arch)',
35 'variables': { 37
36 'conditions': [ 38 # Setting 'v8_can_use_unaligned_accesses' to 'true' will allow the code
37 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { 39 # generated by V8 to do unaligned memory access, and setting it to 'false'
38 # This handles the Linux platforms we generally deal with. Anything 40 # will ensure that the generated code will always do aligned memory
39 # else gets passed through, which probably won't work very well; suc h 41 # accesses. The default value of 'default' will try to determine the correct
40 # hosts should pass an explicit target_arch to gyp. 42 # setting. Note that for Intel architectures (ia32 and x64) unaligned memory
41 'host_arch%': 43 # access is allowed for all CPUs.
42 '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/a rm.*/arm/")', 44 'v8_can_use_unaligned_accesses%': 'default',
43 }, { # OS!="linux" and OS!="freebsd" and OS!="openbsd" 45
44 'host_arch%': 'ia32', 46 # Setting 'v8_can_use_vfp_instructions' to 'true' will enable use of ARM VFP
45 }], 47 # instructions in the V8 generated code. VFP instructions will be enabled
46 ], 48 # both for the snapshot and for the ARM target. Leaving the default value
47 }, 49 # of 'false' will avoid VFP instructions in the snapshot and use CPU feature
48 'host_arch%': '<(host_arch)', 50 # probing when running on the target.
49 'target_arch%': '<(host_arch)', 51 'v8_can_use_vfp_instructions%': 'false',
50 'v8_target_arch%': '<(target_arch)', 52
51 }, 53 # Setting v8_use_arm_eabi_hardfloat to true will turn on V8 support for ARM
52 'host_arch%': '<(host_arch)', 54 # EABI calling convention where double arguments are passed in VFP
53 'target_arch%': '<(target_arch)', 55 # registers. Note that the GCC flag '-mfloat-abi=hard' should be used as
54 'v8_target_arch%': '<(v8_target_arch)', 56 # well when compiling for the ARM target.
57 'v8_use_arm_eabi_hardfloat%': 'false',
58
55 'v8_enable_debugger_support%': 1, 59 'v8_enable_debugger_support%': 1,
56 'conditions': [ 60
57 ['(v8_target_arch=="arm" and host_arch!="arm") or \ 61 # Chrome needs this definition unconditionally. For standalone V8 builds,
58 (v8_target_arch=="x64" and host_arch!="x64")', { 62 # it's handled in build/standalone.gypi.
59 'want_separate_host_toolset': 1, 63 'want_separate_host_toolset%': 1,
60 }, { 64
61 'want_separate_host_toolset': 0, 65 'v8_use_snapshot%': 'true',
62 }], 66 'host_os%': '<(OS)',
63 ], 67 'v8_use_liveobjectlist%': 'false',
64 }, 68 },
65 'target_defaults': { 69 'target_defaults': {
66 'default_configuration': 'Debug',
67 'conditions': [ 70 'conditions': [
68 ['v8_enable_debugger_support==1', { 71 ['v8_enable_debugger_support==1', {
69 'defines': ['ENABLE_DEBUGGER_SUPPORT',], 72 'defines': ['ENABLE_DEBUGGER_SUPPORT',],
70 }, 73 },
71 ], 74 ],
75 ['OS!="mac"', {
76 # TODO(mark): The OS!="mac" conditional is temporary. It can be
77 # removed once the Mac Chromium build stops setting target_arch to
78 # ia32 and instead sets it to mac. Other checks in this file for
79 # OS=="mac" can be removed at that time as well. This can be cleaned
80 # up once http://crbug.com/44205 is fixed.
81 'conditions': [
82 ['v8_target_arch=="arm"', {
83 'defines': [
84 'V8_TARGET_ARCH_ARM',
85 ],
86 'conditions': [
87 [ 'v8_can_use_unaligned_accesses=="true"', {
88 'defines': [
89 'CAN_USE_UNALIGNED_ACCESSES=1',
90 ],
91 }],
92 [ 'v8_can_use_unaligned_accesses=="false"', {
93 'defines': [
94 'CAN_USE_UNALIGNED_ACCESSES=0',
95 ],
96 }],
97 [ 'v8_can_use_vfp_instructions=="true"', {
98 'defines': [
99 'CAN_USE_VFP_INSTRUCTIONS',
100 ],
101 }],
102 [ 'v8_use_arm_eabi_hardfloat=="true"', {
103 'defines': [
104 'USE_EABI_HARDFLOAT=1',
105 'CAN_USE_VFP_INSTRUCTIONS',
106 ],
107 'cflags': [
108 '-mfloat-abi=hard',
109 ],
110 }, {
111 'defines': [
112 'USE_EABI_HARDFLOAT=0',
113 ],
114 }],
115 # The ARM assembler assumes the host is 32 bits,
116 # so force building 32-bit host tools.
117 ['host_arch=="x64"', {
118 'target_conditions': [
119 ['_toolset=="host"', {
120 'cflags': ['-m32'],
121 'ldflags': ['-m32'],
122 }],
123 ],
124 }],
125 ],
126 }],
127 ['v8_target_arch=="ia32"', {
128 'defines': [
129 'V8_TARGET_ARCH_IA32',
130 ],
131 }],
132 ['v8_target_arch=="mips"', {
133 'defines': [
134 'V8_TARGET_ARCH_MIPS',
135 ],
136 }],
137 ['v8_target_arch=="x64"', {
138 'defines': [
139 'V8_TARGET_ARCH_X64',
140 ],
141 }],
142 ],
143 }],
144 ['v8_use_liveobjectlist=="true"', {
145 'defines': [
146 'ENABLE_DEBUGGER_SUPPORT',
147 'INSPECTOR',
148 'OBJECT_PRINT',
149 'LIVEOBJECTLIST',
150 ],
151 }],
152 ['v8_compress_startup_data=="bz2"', {
153 'defines': [
154 'COMPRESS_STARTUP_DATA_BZ2',
155 ],
156 }],
72 ], 157 ],
73 'configurations': { 158 'configurations': {
74 'Debug': { 159 'Debug': {
75 'cflags': [ '-g', '-O0' ], 160 'defines': [
76 'defines': [ 'ENABLE_DISASSEMBLER', 'DEBUG', 'V8_ENABLE_CHECKS', 161 'DEBUG',
77 'OBJECT_PRINT' ], 162 'ENABLE_DISASSEMBLER',
163 'V8_ENABLE_CHECKS',
164 'OBJECT_PRINT',
165 ],
166 'msvs_settings': {
167 'VCCLCompilerTool': {
168 'Optimization': '0',
169
170 'conditions': [
171 ['OS=="win" and component=="shared_library"', {
172 'RuntimeLibrary': '3', # /MDd
173 }, {
174 'RuntimeLibrary': '1', # /MTd
175 }],
176 ],
177 },
178 'VCLinkerTool': {
179 'LinkIncremental': '2',
180 # For future reference, the stack size needs to be increased
181 # when building for Windows 64-bit, otherwise some test cases
182 # can cause stack overflow.
183 # 'StackReserveSize': '297152',
184 },
185 },
186 'conditions': [
187 ['OS=="freebsd" or OS=="openbsd"', {
188 'cflags': [ '-I/usr/local/include' ],
189 }],
190 ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
191 'cflags': [ '-Wall', '-Werror', '-W', '-Wno-unused-parameter',
192 '-Wnon-virtual-dtor' ],
193 }],
194 ],
78 }, 195 },
79 'Release': { 196 'Release': {
80 'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', 197 'conditions': [
81 '-ffunction-sections' ], 198 ['OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
199 'cflags!': [
200 '-O2',
201 '-Os',
202 ],
203 'cflags': [
204 '-fdata-sections',
205 '-ffunction-sections',
206 '-fomit-frame-pointer',
207 '-O3',
208 ],
209 'conditions': [
210 [ 'gcc_version==44', {
211 'cflags': [
212 # Avoid crashes with gcc 4.4 in the v8 test suite.
213 '-fno-tree-vrp',
214 ],
215 }],
216 ],
217 }],
218 ['OS=="freebsd" or OS=="openbsd"', {
219 'cflags': [ '-I/usr/local/include' ],
220 }],
221 ['OS=="mac"', {
222 'xcode_settings': {
223 'GCC_OPTIMIZATION_LEVEL': '3', # -O3
224
225 # -fstrict-aliasing. Mainline gcc
226 # enables this at -O2 and above,
227 # but Apple gcc does not unless it
228 # is specified explicitly.
229 'GCC_STRICT_ALIASING': 'YES',
230 },
231 }],
232 ['OS=="win"', {
233 'msvs_configuration_attributes': {
234 'OutputDirectory': '$(SolutionDir)$(ConfigurationName)',
235 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
236 'CharacterSet': '1',
237 },
238 'msvs_settings': {
239 'VCCLCompilerTool': {
240 'Optimization': '2',
241 'InlineFunctionExpansion': '2',
242 'EnableIntrinsicFunctions': 'true',
243 'FavorSizeOrSpeed': '0',
244 'OmitFramePointers': 'true',
245 'StringPooling': 'true',
246
247 'conditions': [
248 ['OS=="win" and component=="shared_library"', {
249 'RuntimeLibrary': '2', #/MD
250 }, {
251 'RuntimeLibrary': '0', #/MT
252 }],
253 ],
254 },
255 'VCLinkerTool': {
256 'LinkIncremental': '1',
257 'OptimizeReferences': '2',
258 'OptimizeForWindows98': '1',
259 'EnableCOMDATFolding': '2',
260 # For future reference, the stack size needs to be
261 # increased when building for Windows 64-bit, otherwise
262 # some test cases can cause stack overflow.
263 # 'StackReserveSize': '297152',
264 },
265 },
266 }],
267 ],
82 }, 268 },
83 }, 269 },
84 }, 270 },
85 'conditions': [
86 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
87 'target_defaults': {
88 'cflags': [ '-Wall', '-Werror', '-W', '-Wno-unused-parameter',
89 '-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
90 '-fno-exceptions', '-pedantic' ],
91 'ldflags': [ '-pthread', ],
92 'conditions': [
93 [ 'target_arch=="ia32"', {
94 'cflags': [ '-m32' ],
95 'ldflags': [ '-m32' ],
96 }],
97 [ 'OS=="linux"', {
98 'cflags': [ '-ansi' ],
99 }],
100 [ 'visibility=="hidden"', {
101 'cflags': [ '-fvisibility=hidden' ],
102 }],
103 ],
104 },
105 }], # 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"'
106 ['OS=="win"', {
107 'target_defaults': {
108 'defines': [
109 'WIN32',
110 '_CRT_SECURE_NO_DEPRECATE',
111 '_CRT_NONSTDC_NO_DEPRECATE',
112 ],
113 'conditions': [
114 ['component=="static_library"', {
115 'defines': [
116 '_HAS_EXCEPTIONS=0',
117 ],
118 }],
119 ],
120 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
121 'msvs_disabled_warnings': [4355, 4800],
122 'msvs_settings': {
123 'VCCLCompilerTool': {
124 'MinimalRebuild': 'false',
125 'BufferSecurityCheck': 'true',
126 'EnableFunctionLevelLinking': 'true',
127 'RuntimeTypeInfo': 'false',
128 'WarningLevel': '3',
129 'WarnAsError': 'true',
130 'DebugInformationFormat': '3',
131 'Detect64BitPortabilityProblems': 'false',
132 'conditions': [
133 [ 'msvs_multi_core_compile', {
134 'AdditionalOptions': ['/MP'],
135 }],
136 ['component=="shared_library"', {
137 'ExceptionHandling': '1', # /EHsc
138 }, {
139 'ExceptionHandling': '0',
140 }],
141 ],
142 },
143 'VCLibrarianTool': {
144 'AdditionalOptions': ['/ignore:4221'],
145 },
146 'VCLinkerTool': {
147 'AdditionalDependencies': [
148 'ws2_32.lib',
149 ],
150 'GenerateDebugInformation': 'true',
151 'MapFileName': '$(OutDir)\\$(TargetName).map',
152 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
153 'FixedBaseAddress': '1',
154 # LinkIncremental values:
155 # 0 == default
156 # 1 == /INCREMENTAL:NO
157 # 2 == /INCREMENTAL
158 'LinkIncremental': '1',
159 # SubSystem values:
160 # 0 == not set
161 # 1 == /SUBSYSTEM:CONSOLE
162 # 2 == /SUBSYSTEM:WINDOWS
163 'SubSystem': '1',
164 },
165 },
166 },
167 }], # OS=="win"
168 ['OS=="mac"', {
169 'target_defaults': {
170 'xcode_settings': {
171 'ALWAYS_SEARCH_USER_PATHS': 'NO',
172 'GCC_C_LANGUAGE_STANDARD': 'ansi', # -ansi
173 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
174 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
175 # (Equivalent to -fPIC)
176 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
177 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
178 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
179 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
180 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
181 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
182 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
183 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
184 'GCC_VERSION': '4.2',
185 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
186 'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
187 'PREBINDING': 'NO', # No -Wl,-prebind
188 'USE_HEADERMAP': 'NO',
189 'OTHER_CFLAGS': [
190 '-fno-strict-aliasing',
191 ],
192 'WARNING_CFLAGS': [
193 '-Wall',
194 '-Wendif-labels',
195 '-W',
196 '-Wno-unused-parameter',
197 '-Wnon-virtual-dtor',
198 ],
199 },
200 'target_conditions': [
201 ['_type!="static_library"', {
202 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
203 }],
204 ], # target_conditions
205 }, # target_defaults
206 }], # OS=="mac"
207 ],
208 } 271 }
OLDNEW
« no previous file with comments | « Makefile ('k') | build/gyp_v8 » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698