kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 1 | # Copyright 2011 the V8 project authors. All rights reserved. |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 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 | { |
| 29 | 'variables': { |
| 30 | 'library%': 'static_library', |
| 31 | 'component%': 'static_library', |
| 32 | 'visibility%': 'hidden', |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 33 | 'msvs_multi_core_compile%': '1', |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 34 | 'variables': { |
rossberg@chromium.org | 28a3708 | 2011-08-22 11:03:23 +0000 | [diff] [blame^] | 35 | 'variables': { |
| 36 | 'conditions': [ |
| 37 | [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd"', { |
| 38 | # This handles the Linux platforms we generally deal with. Anything |
| 39 | # else gets passed through, which probably won't work very well; such |
| 40 | # hosts should pass an explicit target_arch to gyp. |
| 41 | 'host_arch%': |
| 42 | '<!(uname -m | sed -e "s/i.86/ia32/;s/x86_64/x64/;s/amd64/x64/;s/arm.*/arm/")', |
| 43 | }, { # OS!="linux" and OS!="freebsd" and OS!="openbsd" |
| 44 | 'host_arch%': 'ia32', |
| 45 | }], |
| 46 | ], |
| 47 | }, |
| 48 | 'host_arch%': '<(host_arch)', |
| 49 | 'target_arch%': '<(host_arch)', |
| 50 | 'v8_target_arch%': '<(target_arch)', |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 51 | }, |
| 52 | 'host_arch%': '<(host_arch)', |
rossberg@chromium.org | 28a3708 | 2011-08-22 11:03:23 +0000 | [diff] [blame^] | 53 | 'target_arch%': '<(target_arch)', |
| 54 | 'v8_target_arch%': '<(v8_target_arch)', |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 55 | 'v8_enable_debugger_support%': 1, |
| 56 | 'conditions': [ |
rossberg@chromium.org | 28a3708 | 2011-08-22 11:03:23 +0000 | [diff] [blame^] | 57 | ['(v8_target_arch=="arm" and host_arch!="arm") or \ |
| 58 | (v8_target_arch=="x64" and host_arch!="x64")', { |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 59 | 'want_separate_host_toolset': 1, |
| 60 | }, { |
| 61 | 'want_separate_host_toolset': 0, |
| 62 | }], |
| 63 | ], |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 64 | }, |
| 65 | 'target_defaults': { |
| 66 | 'default_configuration': 'Debug', |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 67 | 'conditions': [ |
| 68 | ['v8_enable_debugger_support==1', { |
| 69 | 'defines': ['ENABLE_DEBUGGER_SUPPORT',], |
| 70 | }, |
| 71 | ], |
| 72 | ], |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 73 | 'configurations': { |
| 74 | 'Debug': { |
| 75 | 'cflags': [ '-g', '-O0' ], |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 76 | 'defines': [ 'ENABLE_DISASSEMBLER', 'DEBUG', 'V8_ENABLE_CHECKS', |
| 77 | 'OBJECT_PRINT' ], |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 78 | }, |
| 79 | 'Release': { |
kmillikin@chromium.org | 7c2628c | 2011-08-10 11:27:35 +0000 | [diff] [blame] | 80 | 'cflags': [ '-O3', '-fomit-frame-pointer', '-fdata-sections', |
| 81 | '-ffunction-sections' ], |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 82 | }, |
| 83 | }, |
| 84 | }, |
| 85 | 'conditions': [ |
| 86 | [ 'OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris"', { |
| 87 | 'target_defaults': { |
rossberg@chromium.org | 28a3708 | 2011-08-22 11:03:23 +0000 | [diff] [blame^] | 88 | 'cflags': [ '-Wall', '-Werror', '-W', '-Wno-unused-parameter', |
| 89 | '-Wnon-virtual-dtor', '-pthread', '-fno-rtti', |
| 90 | '-fno-exceptions', '-pedantic' ], |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 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 | }, |
sgjesse@chromium.org | 8e8294a | 2011-05-02 14:30:53 +0000 | [diff] [blame] | 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 | }, |
svenpanne@chromium.org | 6d786c9 | 2011-06-15 10:58:27 +0000 | [diff] [blame] | 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" |
ager@chromium.org | 5f0c45f | 2010-12-17 08:51:21 +0000 | [diff] [blame] | 207 | ], |
| 208 | } |