| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 1 | # conditions used in both common.gypi and skia.gyp in chromium |
| 2 | # |
| 3 | { |
| 4 | 'conditions' : [ |
| 5 | |
| 6 | ['skia_os == "win"', |
| 7 | { |
| 8 | 'defines': [ |
| 9 | 'SK_BUILD_FOR_WIN32', |
| 10 | 'SK_IGNORE_STDINT_DOT_H', |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 11 | '_CRT_SECURE_NO_WARNINGS', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 12 | ], |
| 13 | 'msvs_cygwin_shell': 0, |
| 14 | 'msvs_settings': { |
| 15 | 'VCCLCompilerTool': { |
| 16 | 'WarningLevel': '1', |
| 17 | 'WarnAsError': 'false', |
| 18 | 'DebugInformationFormat': '3', |
| seanpaul@google.com | 8f78fec | 2011-09-16 15:47:33 +0000 | [diff] [blame] | 19 | 'AdditionalOptions': [ '/MP' ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 20 | }, |
| 21 | 'VCLinkerTool': { |
| 22 | 'AdditionalDependencies': [ |
| 23 | 'OpenGL32.lib', |
| 24 | 'usp10.lib', |
| 25 | ], |
| 26 | }, |
| 27 | }, |
| 28 | 'configurations': { |
| 29 | 'Debug': { |
| 30 | 'msvs_settings': { |
| 31 | 'VCCLCompilerTool': { |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 32 | 'DebugInformationFormat': '4', # editAndContiue (/ZI) |
| bungeman@google.com | 7deaa3b | 2011-10-03 20:15:13 +0000 | [diff] [blame] | 33 | 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 34 | 'Optimization': '0', # optimizeDisabled (/Od) |
| 35 | 'PreprocessorDefinitions': ['_DEBUG'], |
| 36 | 'RuntimeLibrary': '3', # rtMultiThreadedDebugDLL (/MDd) |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 37 | 'ExceptionHandling': '0', |
| 38 | 'RuntimeTypeInfo': 'false', # /GR- |
| 39 | 'WarningLevel': '3', # level3 (/W3) |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 40 | }, |
| 41 | 'VCLinkerTool': { |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 42 | 'GenerateDebugInformation': 'true', # /DEBUG |
| 43 | 'LinkIncremental': '2', # /INCREMENTAL |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 44 | }, |
| 45 | }, |
| 46 | }, |
| 47 | 'Release': { |
| 48 | 'msvs_settings': { |
| 49 | 'VCCLCompilerTool': { |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 50 | 'DebugInformationFormat': '3', # programDatabase (/Zi) |
| bungeman@google.com | 7deaa3b | 2011-10-03 20:15:13 +0000 | [diff] [blame] | 51 | 'ProgramDataBaseFileName': '$(OutDir)\\$(ProjectName).pdb', |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 52 | 'Optimization': '3', # full (/Ox) |
| 53 | 'WholeProgramOptimization': 'true', #/GL |
| 54 | # Changing the floating point model requires rebaseling gm images |
| 55 | #'FloatingPointModel': '2', # fast (/fp:fast) |
| 56 | 'FavorSizeOrSpeed': '1', # speed (/Ot) |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 57 | 'PreprocessorDefinitions': ['NDEBUG'], |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 58 | 'RuntimeLibrary': '2', # rtMultiThreadedDLL (/MD) |
| 59 | 'ExceptionHandling': '0', |
| 60 | 'RuntimeTypeInfo': 'false', # /GR- |
| 61 | 'WarningLevel': '3', # level3 (/W3) |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 62 | }, |
| 63 | 'VCLinkerTool': { |
| bsalomon@google.com | 8b5abec | 2011-09-28 14:32:01 +0000 | [diff] [blame] | 64 | 'GenerateDebugInformation': 'true', # /DEBUG |
| 65 | 'LinkTimeCodeGeneration': '1', # useLinkTimeCodeGeneration /LTCG |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 66 | }, |
| bungeman@google.com | 983297e | 2011-10-03 19:36:51 +0000 | [diff] [blame] | 67 | 'VCLibrarianTool': { |
| 68 | 'LinkTimeCodeGeneration': 'true', # useLinkTimeCodeGeneration /LTCG |
| 69 | }, |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 70 | }, |
| 71 | }, |
| 72 | }, |
| 73 | }, |
| 74 | ], |
| 75 | |
| 76 | ['skia_os in ["linux", "freebsd", "openbsd", "solaris"]', |
| 77 | { |
| 78 | 'defines': [ |
| 79 | 'SK_SAMPLES_FOR_X', |
| 80 | 'SK_BUILD_FOR_UNIX', |
| 81 | ], |
| 82 | 'configurations': { |
| 83 | 'Debug': { |
| 84 | 'cflags': ['-g'] |
| 85 | }, |
| 86 | 'Release': { |
| senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame^] | 87 | 'cflags': ['-O2'], |
| 88 | 'defines': [ 'NDEBUG' ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 89 | }, |
| 90 | }, |
| bsalomon@google.com | cadbcb8 | 2012-01-06 19:22:11 +0000 | [diff] [blame] | 91 | 'cflags': [ |
| 92 | # TODO(tony): Enable -Werror once all the strict-aliasing problems |
| 93 | # are fixed. |
| 94 | #'-Werror', |
| bsalomon@google.com | 31648eb | 2011-11-23 15:01:08 +0000 | [diff] [blame] | 95 | '-Wall', |
| 96 | '-Wextra', |
| 97 | '-Wno-unused', |
| 98 | # suppressions below here were added for clang |
| 99 | '-Wno-unused-parameter', |
| 100 | '-Wno-c++11-extensions' |
| 101 | ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 102 | 'include_dirs' : [ |
| 103 | '/usr/include/freetype2', |
| 104 | ], |
| 105 | }, |
| 106 | ], |
| 107 | |
| 108 | ['skia_os == "mac"', |
| 109 | { |
| 110 | 'defines': [ |
| 111 | 'SK_BUILD_FOR_MAC', |
| 112 | ], |
| 113 | 'configurations': { |
| 114 | 'Debug': { |
| 115 | 'xcode_settings': { |
| 116 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 117 | }, |
| 118 | }, |
| reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 119 | 'Release': { |
| 120 | 'xcode_settings': { |
| 121 | 'GCC_OPTIMIZATION_LEVEL': '3', |
| 122 | }, |
| senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame^] | 123 | 'defines': [ 'NDEBUG' ], |
| reed@google.com | e05cc8e | 2011-10-10 14:19:40 +0000 | [diff] [blame] | 124 | }, |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 125 | }, |
| 126 | 'xcode_settings': { |
| 127 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| bsalomon@google.com | 4d5cb45 | 2011-10-12 18:12:11 +0000 | [diff] [blame] | 128 | 'SDKROOT': 'macosx10.6', |
| reed@google.com | 0069aa5 | 2011-11-17 15:35:47 +0000 | [diff] [blame] | 129 | # trying to get this to work, but it needs clang I think... |
| 130 | # 'WARNING_CFLAGS': '-Wexit-time-destructors', |
| mike@reedtribe.org | e51755f | 2011-12-10 19:36:56 +0000 | [diff] [blame] | 131 | 'CLANG_WARN_CXX0X_EXTENSIONS': 'NO', |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 132 | }, |
| 133 | }, |
| 134 | ], |
| 135 | |
| 136 | ['skia_os == "ios"', |
| 137 | { |
| 138 | 'defines': [ |
| 139 | 'SK_BUILD_FOR_IOS', |
| 140 | ], |
| 141 | 'configurations': { |
| 142 | 'Debug': { |
| 143 | 'xcode_settings': { |
| 144 | 'GCC_OPTIMIZATION_LEVEL': '0', |
| 145 | }, |
| 146 | }, |
| 147 | }, |
| 148 | 'xcode_settings': { |
| 149 | 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 150 | }, |
| 151 | }, |
| 152 | ], |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 153 | |
| 154 | ['skia_os == "android"', |
| 155 | { |
| 156 | 'defines': [ |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 157 | 'SK_BUILD_FOR_ANDROID', |
| 158 | 'SK_BUILD_FOR_ANDROID_NDK', |
| digit@google.com | 70ccffe | 2012-01-10 10:28:30 +0000 | [diff] [blame] | 159 | 'SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=0', |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 160 | ], |
| 161 | 'configurations': { |
| 162 | 'Debug': { |
| 163 | 'cflags': ['-g'] |
| 164 | }, |
| 165 | 'Release': { |
| senorblanco@chromium.org | 7288c49 | 2012-01-19 19:59:22 +0000 | [diff] [blame^] | 166 | 'cflags': ['-O2'], |
| 167 | 'defines': [ 'NDEBUG' ], |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 168 | }, |
| 169 | }, |
| 170 | 'libraries': [ |
| 171 | '-lstdc++', |
| 172 | '-lm', |
| djsollen@google.com | 318cf92 | 2011-11-08 19:03:43 +0000 | [diff] [blame] | 173 | '-llog', |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 174 | ], |
| djsollen@google.com | 44360bc | 2011-12-05 13:55:55 +0000 | [diff] [blame] | 175 | 'cflags': [ |
| 176 | '-fno-exceptions', |
| 177 | '-fno-rtti', |
| 178 | ], |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 179 | 'conditions': [ |
| djsollen@google.com | 3839ca1 | 2011-11-03 17:31:41 +0000 | [diff] [blame] | 180 | [ 'skia_target_arch == "arm" and arm_thumb == 1', { |
| 181 | 'cflags': [ |
| 182 | '-mthumb', |
| 183 | ], |
| 184 | }], |
| djsollen@google.com | 5862929 | 2011-11-03 13:08:29 +0000 | [diff] [blame] | 185 | [ 'skia_target_arch == "arm" and armv7 == 1', { |
| 186 | 'defines': [ |
| 187 | '__ARM_ARCH__=7', |
| 188 | ], |
| 189 | 'cflags': [ |
| 190 | '-march=armv7-a', |
| 191 | ], |
| 192 | 'conditions': [ |
| 193 | [ 'arm_neon == 1', { |
| 194 | 'defines': [ |
| 195 | '__ARM_HAVE_NEON', |
| 196 | ], |
| 197 | 'cflags': [ |
| 198 | '-mfloat-abi=softfp', |
| 199 | '-mfpu=neon', |
| 200 | ], |
| 201 | }], |
| 202 | ], |
| 203 | }], |
| 204 | ], |
| 205 | }, |
| 206 | ], |
| seanpaul@google.com | 1134f98 | 2011-09-15 14:24:33 +0000 | [diff] [blame] | 207 | |
| 208 | ], # end 'conditions' |
| 209 | } |
| 210 | |
| 211 | # Local Variables: |
| 212 | # tab-width:2 |
| 213 | # indent-tabs-mode:nil |
| 214 | # End: |
| 215 | # vim: set expandtab tabstop=2 shiftwidth=2: |