blob: 81909f19a865818cb6b4c6a17232ecdec091cbe3 [file] [log] [blame]
Ben Murdoch69a99ed2011-11-30 16:03:39 +00001# Copyright 2011 the V8 project authors. All rights reserved.
2# Redistribution and use in source and binary forms, with or without
3# modification, are permitted provided that the following conditions are
4# met:
5#
6# * Redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer.
8# * Redistributions in binary form must reproduce the above
9# copyright notice, this list of conditions and the following
10# disclaimer in the documentation and/or other materials provided
11# with the distribution.
12# * Neither the name of Google Inc. nor the names of its
13# contributors may be used to endorse or promote products derived
14# from this software without specific prior written permission.
15#
16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
27
28# Definitions to be used when building stand-alone V8 binaries.
29
30{
31 'variables': {
32 'library%': 'static_library',
33 'component%': 'static_library',
34 'visibility%': 'hidden',
35 'msvs_multi_core_compile%': '1',
36 'variables': {
37 'variables': {
38 'conditions': [
39 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', {
40 # This handles the Linux platforms we generally deal with. Anything
41 # else gets passed through, which probably won't work very well; such
42 # hosts should pass an explicit target_arch to gyp.
43 'host_arch%':
44 '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")',
45 }, { # OS!="linux" and OS!="freebsd" and OS!="openbsd"
46 'host_arch%': 'ia32',
47 }],
48 ],
49 },
50 'host_arch%': '<(host_arch)',
51 'target_arch%': '<(host_arch)',
52 'v8_target_arch%': '<(target_arch)',
53 },
54 'host_arch%': '<(host_arch)',
55 'target_arch%': '<(target_arch)',
56 'v8_target_arch%': '<(v8_target_arch)',
57 'conditions': [
58 ['(v8_target_arch=="arm" and host_arch!="arm") or \
59 (v8_target_arch=="x64" and host_arch!="x64")', {
60 'want_separate_host_toolset': 1,
61 }, {
62 'want_separate_host_toolset': 0,
63 }],
64 ],
65 },
66 'target_defaults': {
67 'default_configuration': 'Debug',
68 'configurations': {
69 'Debug': {
70 'cflags': [ '-g', '-O0' ],
71 },
72 },
73 },
74 'conditions': [
75 [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', {
76 'target_defaults': {
77 'cflags': [ '-Wall', '-Werror', '-W', '-Wno-unused-parameter',
78 '-Wnon-virtual-dtor', '-pthread', '-fno-rtti',
79 '-fno-exceptions', '-pedantic' ],
80 'ldflags': [ '-pthread', ],
81 'conditions': [
82 [ 'target_arch=="ia32"', {
83 'cflags': [ '-m32' ],
84 'ldflags': [ '-m32' ],
85 }],
86 [ 'OS=="linux"', {
87 'cflags': [ '-ansi' ],
88 }],
89 [ 'visibility=="hidden"', {
90 'cflags': [ '-fvisibility=hidden' ],
91 }],
92 [ 'component=="shared_library"', {
93 'cflags': [ '-fPIC', ],
94 }],
95 ],
96 },
97 }], # 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"'
98 ['OS=="win"', {
99 'target_defaults': {
100 'defines': [
101 'WIN32',
102 '_CRT_SECURE_NO_DEPRECATE',
103 '_CRT_NONSTDC_NO_DEPRECATE',
104 ],
105 'conditions': [
106 ['component=="static_library"', {
107 'defines': [
108 '_HAS_EXCEPTIONS=0',
109 ],
110 }],
111 ],
112 'msvs_cygwin_dirs': ['<(DEPTH)/third_party/cygwin'],
113 'msvs_disabled_warnings': [4355, 4800],
114 'msvs_settings': {
115 'VCCLCompilerTool': {
116 'MinimalRebuild': 'false',
117 'BufferSecurityCheck': 'true',
118 'EnableFunctionLevelLinking': 'true',
119 'RuntimeTypeInfo': 'false',
120 'WarningLevel': '3',
121 'WarnAsError': 'true',
122 'DebugInformationFormat': '3',
123 'Detect64BitPortabilityProblems': 'false',
124 'conditions': [
125 [ 'msvs_multi_core_compile', {
126 'AdditionalOptions': ['/MP'],
127 }],
128 ['component=="shared_library"', {
129 'ExceptionHandling': '1', # /EHsc
130 }, {
131 'ExceptionHandling': '0',
132 }],
133 ],
134 },
135 'VCLibrarianTool': {
136 'AdditionalOptions': ['/ignore:4221'],
137 },
138 'VCLinkerTool': {
139 'AdditionalDependencies': [
140 'ws2_32.lib',
141 ],
142 'GenerateDebugInformation': 'true',
143 'MapFileName': '$(OutDir)\\$(TargetName).map',
144 'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
145 'FixedBaseAddress': '1',
146 # LinkIncremental values:
147 # 0 == default
148 # 1 == /INCREMENTAL:NO
149 # 2 == /INCREMENTAL
150 'LinkIncremental': '1',
151 # SubSystem values:
152 # 0 == not set
153 # 1 == /SUBSYSTEM:CONSOLE
154 # 2 == /SUBSYSTEM:WINDOWS
155 'SubSystem': '1',
156 },
157 },
158 },
159 }], # OS=="win"
160 ['OS=="mac"', {
161 'target_defaults': {
162 'xcode_settings': {
163 'ALWAYS_SEARCH_USER_PATHS': 'NO',
164 'GCC_C_LANGUAGE_STANDARD': 'ansi', # -ansi
165 'GCC_CW_ASM_SYNTAX': 'NO', # No -fasm-blocks
166 'GCC_DYNAMIC_NO_PIC': 'NO', # No -mdynamic-no-pic
167 # (Equivalent to -fPIC)
168 'GCC_ENABLE_CPP_EXCEPTIONS': 'NO', # -fno-exceptions
169 'GCC_ENABLE_CPP_RTTI': 'NO', # -fno-rtti
170 'GCC_ENABLE_PASCAL_STRINGS': 'NO', # No -mpascal-strings
171 # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
172 'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
173 'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES', # -fvisibility=hidden
174 'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
175 'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES', # -Werror
176 'GCC_VERSION': '4.2',
177 'GCC_WARN_ABOUT_MISSING_NEWLINE': 'YES', # -Wnewline-eof
178 'MACOSX_DEPLOYMENT_TARGET': '10.4', # -mmacosx-version-min=10.4
179 'PREBINDING': 'NO', # No -Wl,-prebind
180 'USE_HEADERMAP': 'NO',
181 'OTHER_CFLAGS': [
182 '-fno-strict-aliasing',
183 ],
184 'WARNING_CFLAGS': [
185 '-Wall',
186 '-Wendif-labels',
187 '-W',
188 '-Wno-unused-parameter',
189 '-Wnon-virtual-dtor',
190 ],
191 },
192 'target_conditions': [
193 ['_type!="static_library"', {
194 'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
195 }],
196 ], # target_conditions
197 }, # target_defaults
198 }], # OS=="mac"
199 ],
200}