brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 1 | # This file gets passed to gyp with -I so that it gets included everywhere. |
| 2 | { |
| 3 | 'variables': { |
| 4 | 'AOS': '<(DEPTH)/aos', |
| 5 | # A directory with everything in it ignored from source control. |
| 6 | 'TMPDIR': '<(DEPTH)/aos/build/temp', |
| 7 | 'aos_abs': '<!(readlink -f <(DEPTH)/aos)', # for use in non-path contexts |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 8 | # The .gyp file that has targets for the various external libraries. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 9 | 'EXTERNALS': '<(AOS)/build/externals.gyp', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 10 | # The directory that gets rsynced to the target. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 11 | 'rsync_dir': '<(PRODUCT_DIR)/outputs', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 12 | # The directory that executables that depend on <(EXTERNALS):gtest get put into. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 13 | 'test_dir': '<(PRODUCT_DIR)/tests', |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 14 | |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 15 | # Stuck into a variable (with a space on the end) to make disabling it easy. |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 16 | 'ccache': '<!(which ccache) ', |
Brian Silverman | 1294c08 | 2014-05-20 17:02:29 -0700 | [diff] [blame] | 17 | |
| 18 | 'disable_sanitizers': [ |
| 19 | # Bad alignment is just slow on x86 and traps on ARM, so we'll find |
| 20 | # it other ways, and some x86 code does it on purpose. |
| 21 | 'alignment', |
| 22 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 23 | }, |
| 24 | 'conditions': [ |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 25 | ['PLATFORM=="crio"', { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 26 | 'make_global_settings': [ |
Brian Silverman | a67ecc7 | 2013-09-28 13:53:53 -0700 | [diff] [blame] | 27 | ['CC', '<!(readlink -f <(AOS)/build/crio_cc)'], |
| 28 | ['CXX', '<!(readlink -f <(AOS)/build/crio_cxx)'], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 29 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 30 | } |
Brian Silverman | bae86d6 | 2014-09-14 01:05:31 -0400 | [diff] [blame^] | 31 | ], ['PLATFORM=="linux-arm-gcc_frc"', { |
| 32 | 'make_global_settings': [ |
| 33 | ['CC', '<(ccache)<!(which arm-frc-linux-gnueabi-gcc-4.9)'], |
| 34 | ['CXX', '<(ccache)<!(which arm-frc-linux-gnueabi-g++-4.9)'], |
| 35 | ], |
| 36 | }, |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame] | 37 | ], ['PLATFORM=="linux-arm-gcc"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 38 | 'make_global_settings': [ |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 39 | ['CC', '<(ccache)<!(which arm-linux-gnueabihf-gcc-4.7)'], |
| 40 | ['CXX', '<(ccache)<!(which arm-linux-gnueabihf-g++-4.7)'], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 41 | ], |
| 42 | }, |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame] | 43 | ], ['PLATFORM=="linux-arm-clang"', { |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 44 | 'variables': { |
| 45 | 'arm-clang-symlinks': '<!(realpath -s <(AOS)/build/arm-clang-symlinks)', |
| 46 | 'arm-clang-sysroot': '<(arm-clang-symlinks)/sysroot', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 47 | # Flags that should be passed to all compile/link/etc commands. |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 48 | 'platflags': [ |
| 49 | '-target', 'armv7a-linux-gnueabihf', |
| 50 | '-mfloat-abi=hard', |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 51 | '--sysroot=<(arm-clang-sysroot)', |
| 52 | |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 53 | # TODO(brians): See if it will run with this enabled. |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 54 | #-mhwdiv=arm,thumb |
| 55 | ], |
| 56 | }, |
| 57 | 'make_global_settings': [ |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 58 | ['CC', '<(ccache)<(arm-clang-symlinks)/bin/clang'], |
| 59 | ['CXX', '<(ccache)<(arm-clang-symlinks)/bin/clang++'], |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 60 | ], |
| 61 | 'target_defaults': { |
| 62 | 'cflags': [ |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 63 | '<@(platflags)', |
| 64 | ], |
Brian Silverman | 34d25f2 | 2014-05-01 13:30:56 -0700 | [diff] [blame] | 65 | 'cflags_cc': [ |
| 66 | '-isystem', '<(arm-clang-sysroot)/usr/include/c++/4.7.2', |
| 67 | '-isystem', '<(arm-clang-sysroot)/usr/include/c++/4.7.2/arm-linux-gnueabihf', |
| 68 | ], |
Brian Silverman | a8c0452 | 2014-04-27 20:03:08 -0700 | [diff] [blame] | 69 | 'ldflags': [ |
| 70 | '<@(platflags)', |
| 71 | ], |
| 72 | }, |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 73 | }, |
| 74 | ], ['PLATFORM=="linux-amd64-clang"', { |
| 75 | 'make_global_settings': [ |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 76 | ['CC', '<(ccache)/opt/clang-3.5/bin/clang'], |
| 77 | ['CXX', '<(ccache)/opt/clang-3.5/bin/clang++'], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 78 | ], |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 79 | }, |
| 80 | ], ['PLATFORM=="linux-amd64-gcc"', { |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 81 | 'make_global_settings': [ |
Brian Silverman | 9b7a684 | 2014-05-05 16:19:11 -0700 | [diff] [blame] | 82 | ['CC', '<(ccache)<!(which gcc-4.7)'], |
| 83 | ['CXX', '<(ccache)<!(which g++-4.7)'], |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 84 | ], |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 85 | }, |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 86 | ], ['PLATFORM=="linux-amd64-gcc_4.8"', { |
| 87 | 'make_global_settings': [ |
Brian Silverman | d3fac73 | 2014-05-03 16:03:46 -0700 | [diff] [blame] | 88 | ['CC', '<(ccache)/opt/clang-3.5/bin/gcc'], |
| 89 | ['CXX', '<(ccache)/opt/clang-3.5/bin/g++'], |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 90 | ], |
| 91 | }, |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 92 | ], ['SANITIZER!="none"', { |
Brian Silverman | a4aff56 | 2014-05-02 17:43:50 -0700 | [diff] [blame] | 93 | 'target_defaults': { |
| 94 | 'cflags': [ |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 95 | '-fsanitize=<(SANITIZER)', |
Brian Silverman | a4aff56 | 2014-05-02 17:43:50 -0700 | [diff] [blame] | 96 | ], |
| 97 | 'ldflags': [ |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 98 | '-fsanitize=<(SANITIZER)', |
Brian Silverman | a4aff56 | 2014-05-02 17:43:50 -0700 | [diff] [blame] | 99 | ], |
Brian Silverman | 889f85e | 2014-09-05 11:39:09 -0400 | [diff] [blame] | 100 | 'defines': [ |
| 101 | # GCC doesn't have __has_feature, so we have to use this instead. |
| 102 | 'AOS_SANITIZER_<(SANITIZER)', |
| 103 | ], |
Brian Silverman | a4aff56 | 2014-05-02 17:43:50 -0700 | [diff] [blame] | 104 | }, |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 105 | }, |
Brian Silverman | 1294c08 | 2014-05-20 17:02:29 -0700 | [diff] [blame] | 106 | ], ['SANITIZER!="none" and COMPILER!="gcc"', { |
| 107 | 'target_defaults': { |
| 108 | 'cflags': [ |
| 109 | '-fno-sanitize-recover', |
| 110 | '-fno-sanitize=<!(echo <(disable_sanitizers) | sed "s/ /,/g")', |
| 111 | ], |
| 112 | }, |
| 113 | }, |
Brian Silverman | 99895b9 | 2014-09-14 01:01:15 -0400 | [diff] [blame] | 114 | ], ['EXTERNALS_EXTRA=="-fPIE"', { |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 115 | 'target_defaults': { |
| 116 | 'cflags': [ |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 117 | '-fPIE', |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 118 | ], |
| 119 | 'ldflags': [ |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 120 | '-fPIE', |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 121 | ], |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 122 | 'link_settings': { |
| 123 | 'ldflags': [ |
| 124 | '-pie', |
| 125 | ], |
| 126 | }, |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 127 | }, |
| 128 | }, |
| 129 | ], ['SANITIZER=="memory"', { |
| 130 | 'target_defaults': { |
| 131 | 'cflags': [ |
| 132 | '-fsanitize-memory-track-origins', |
| 133 | ], |
| 134 | 'ldflags': [ |
| 135 | '-fsanitize-memory-track-origins', |
| 136 | ], |
| 137 | }, |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 138 | }, |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 139 | ], |
| 140 | ], |
| 141 | 'target_defaults': { |
| 142 | 'defines': [ |
| 143 | '__STDC_FORMAT_MACROS', |
Brian Silverman | 6137a50 | 2013-04-22 15:41:36 -0700 | [diff] [blame] | 144 | '__STDC_CONSTANT_MACROS', |
| 145 | '__STDC_LIMIT_MACROS', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 146 | ], |
| 147 | 'ldflags': [ |
| 148 | '-pipe', |
| 149 | ], |
| 150 | 'cflags': [ |
| 151 | '-pipe', |
| 152 | |
| 153 | '-Wall', |
| 154 | '-Wextra', |
| 155 | '-Wswitch-enum', |
| 156 | '-Wpointer-arith', |
| 157 | '-Wstrict-aliasing=2', |
| 158 | '-Wcast-qual', |
| 159 | '-Wcast-align', |
| 160 | '-Wwrite-strings', |
| 161 | '-Wtype-limits', |
| 162 | '-Wsign-compare', |
| 163 | '-Wformat=2', |
| 164 | '-Werror', |
Brian Silverman | 9ba2bc4 | 2013-03-17 14:18:33 -0700 | [diff] [blame] | 165 | |
| 166 | '-ggdb3', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 167 | ], |
| 168 | 'cflags_c': [ |
| 169 | '-std=gnu99', |
| 170 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 171 | 'include_dirs': [ |
| 172 | '<(DEPTH)', |
| 173 | ], |
Brian Silverman | d0a52dc | 2013-09-23 17:55:37 -0700 | [diff] [blame] | 174 | # These have to be here because apparently gyp evaluates target_conditions |
| 175 | # even if the target is never used. |
| 176 | 'variables': { |
| 177 | # Set this to 1 to disable rsyncing the file to the target. |
| 178 | 'no_rsync%': 0, |
Brian Silverman | 2a36ddb | 2014-04-08 17:07:28 -0700 | [diff] [blame] | 179 | # Set this to 1 if this file is a test that should not be run by |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 180 | # `build.py tests`. |
Brian Silverman | d0a52dc | 2013-09-23 17:55:37 -0700 | [diff] [blame] | 181 | 'is_special_test%': 0, |
| 182 | }, |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 183 | 'conditions': [ |
| 184 | ['DEBUG=="yes"', { |
Brian Silverman | aac705c | 2014-05-01 18:55:34 -0700 | [diff] [blame] | 185 | 'defines': [ |
| 186 | 'AOS_DEBUG=1', |
| 187 | ], |
Brian Silverman | 266811f | 2014-05-03 22:48:04 -0700 | [diff] [blame] | 188 | 'conditions': [['SANITIZER=="none"', { |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 189 | 'cflags': [ |
| 190 | '-O0', |
| 191 | ], |
| 192 | }, { |
| 193 | 'cflags': [ |
| 194 | '-O1', |
| 195 | ], |
| 196 | } |
| 197 | ]], |
| 198 | }, { # 'DEBUG=="no"' |
Brian Silverman | aac705c | 2014-05-01 18:55:34 -0700 | [diff] [blame] | 199 | 'defines': [ |
| 200 | 'AOS_DEBUG=0', |
Brian Silverman | 3b6d320 | 2014-09-14 01:01:54 -0400 | [diff] [blame] | 201 | '_FORTIFY_SOURCE=2', |
Brian Silverman | aac705c | 2014-05-01 18:55:34 -0700 | [diff] [blame] | 202 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 203 | 'cflags': [ |
| 204 | '-O3', |
Brian Silverman | 2a36ddb | 2014-04-08 17:07:28 -0700 | [diff] [blame] | 205 | '-fomit-frame-pointer', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 206 | ], |
Brian Silverman | efb993f | 2013-08-30 19:52:57 -0700 | [diff] [blame] | 207 | 'ldflags': [ |
| 208 | '-O3', |
| 209 | ], |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 210 | 'conditions': [['PLATFORM=="crio"', { |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 211 | # Copied from stuff that I think started with the supplied Makefiles. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 212 | 'cflags': [ |
| 213 | '-fstrength-reduce', |
| 214 | '-fno-builtin', |
| 215 | '-fno-strict-aliasing', |
| 216 | ], |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 217 | }], |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 218 | ['ARCHITECTURE=="amd64"', { |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 219 | 'cflags': [ |
Brian Silverman | 41abe01 | 2014-02-08 18:25:02 -0800 | [diff] [blame] | 220 | '-fstack-protector-all', |
| 221 | ], |
| 222 | }], |
| 223 | ] |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 224 | } |
| 225 | ], |
Brian Silverman | 47cd6f6 | 2014-05-03 10:35:52 -0700 | [diff] [blame] | 226 | ['OS=="linux" and ARCHITECTURE=="arm" and COMPILER=="gcc" and DEBUG=="yes"', { |
Brian Silverman | 134e522 | 2014-04-27 20:10:05 -0700 | [diff] [blame] | 227 | 'cflags': [ |
| 228 | # GCC doesn't like letting us use r7 (which is also the frame |
| 229 | # pointer) to pass the syscall number to the kernel even when |
| 230 | # it's marked as clobbered. |
| 231 | # See <https://bugzilla.mozilla.org/show_bug.cgi?id=633436> for |
| 232 | # some more discussion. |
| 233 | '-fomit-frame-pointer', |
| 234 | ], |
| 235 | } |
| 236 | ], |
Brian Silverman | bae86d6 | 2014-09-14 01:05:31 -0400 | [diff] [blame^] | 237 | ['ARCHITECTURE=="arm" and FULL_COMPILER!="gcc_frc"', { |
Brian Silverman | 10b8a2b | 2014-09-14 01:04:25 -0400 | [diff] [blame] | 238 | 'cflags': [ |
| 239 | '-mcpu=cortex-a8', |
| 240 | '-mfpu=neon', |
| 241 | ], |
| 242 | 'ldflags': [ |
| 243 | '-mcpu=cortex-a8', |
| 244 | '-mfpu=neon', |
| 245 | ], |
| 246 | }], |
Brian Silverman | bae86d6 | 2014-09-14 01:05:31 -0400 | [diff] [blame^] | 247 | ['ARCHITECTURE=="arm" and FULL_COMPILER=="gcc_frc"', { |
| 248 | 'cflags': [ |
| 249 | '-mcpu=cortex-a9', |
| 250 | '-mfpu=neon', |
| 251 | '-mfloat-abi=softfp', |
| 252 | ], |
| 253 | 'ldflags': [ |
| 254 | '-mcpu=cortex-a9', |
| 255 | '-mfpu=neon', |
| 256 | '-mfloat-abi=softfp', |
| 257 | ], |
| 258 | }], |
Brian Silverman | b3d5054 | 2014-04-23 14:28:55 -0500 | [diff] [blame] | 259 | ['PLATFORM=="crio"', { |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 260 | 'target_conditions': [ |
| 261 | ['_type=="shared_library"', { |
| 262 | 'ldflags': [ |
| 263 | '-r', |
| 264 | '-nostdlib', |
| 265 | '-Wl,-X', |
| 266 | ], |
| 267 | } |
| 268 | ], |
| 269 | ], |
| 270 | 'ldflags': [ |
Brian Silverman | 1579fc1 | 2013-04-22 15:41:55 -0700 | [diff] [blame] | 271 | '-mcpu=603e', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 272 | '-mstrict-align', |
| 273 | '-mlongcall', |
| 274 | ], |
| 275 | 'cflags': [ |
Brian Silverman | 1579fc1 | 2013-04-22 15:41:55 -0700 | [diff] [blame] | 276 | # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both |
| 277 | # have MPC603e cores according to Freescale docs. |
| 278 | '-mcpu=603e', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 279 | '-mstrict-align', |
| 280 | '-mlongcall', |
Brian Silverman | 823f324 | 2013-11-17 13:20:22 -0800 | [diff] [blame] | 281 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/', |
| 282 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/vxworks-6.3/target/h/', |
| 283 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/', |
| 284 | '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 285 | '-isystem', '<(WIND_BASE)/target/h', |
| 286 | '-isystem', '<(WIND_BASE)/target/h/wrn/coreip', |
| 287 | ], |
Brian Silverman | 6e20668 | 2013-08-31 11:43:35 -0700 | [diff] [blame] | 288 | 'cflags_cc': [ |
| 289 | '-std=gnu++0x', |
| 290 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 291 | 'defines': [ |
| 292 | 'CPU=PPC603', |
| 293 | 'TOOL_FAMILY=gnu', |
| 294 | 'TOOL=gnu', |
| 295 | '_WRS_KERNEL', |
| 296 | '__PPC__', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 297 | # Prevent the vxworks system headers from being dumb and #defining min and max. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 298 | 'NOMINMAX', |
| 299 | ], |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 300 | }, { # 'PLATFORM!="crio"' |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 301 | 'target_conditions': [ |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 302 | # Default to putting outputs into rsync_dir. |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 303 | ['no_rsync==0 and _type!="static_library"', { |
| 304 | 'product_dir': '<(rsync_dir)', |
| 305 | }, |
| 306 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 307 | ], |
| 308 | 'ldflags': [ |
| 309 | '-pthread', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 310 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 311 | 'cflags': [ |
| 312 | '-pthread', |
Brian Silverman | 6e20668 | 2013-08-31 11:43:35 -0700 | [diff] [blame] | 313 | ], |
| 314 | 'cflags_cc': [ |
| 315 | '-std=gnu++11', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 316 | ], |
| 317 | 'defines': [ |
Brian Silverman | efb993f | 2013-08-30 19:52:57 -0700 | [diff] [blame] | 318 | '_FILE_OFFSET_BITS=64', |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 319 | ], |
| 320 | 'libraries': [ |
| 321 | '-lm', |
| 322 | '-lrt', |
| 323 | ], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 324 | 'conditions': [ |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame] | 325 | ['COMPILER=="gcc"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 326 | 'cflags': [ |
| 327 | '-Wunused-local-typedefs', |
| 328 | ], |
Brian Silverman | f0d3c78 | 2014-05-02 23:56:32 -0700 | [diff] [blame] | 329 | 'defines': [ |
| 330 | '__has_feature(n)=0' |
| 331 | ], |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 332 | }, |
Brian Silverman | a29ebf9 | 2014-04-23 13:08:49 -0500 | [diff] [blame] | 333 | ], ['COMPILER=="clang"', { |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 334 | 'cflags': [ |
| 335 | '-fcolor-diagnostics', |
Brian Silverman | e6bada6 | 2014-05-04 16:16:54 -0700 | [diff] [blame] | 336 | '-fmessage-length=80', |
Brian Silverman | ad09fd7 | 2014-08-14 23:38:36 -0700 | [diff] [blame] | 337 | '-fmacro-backtrace-limit=0', |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 338 | ], |
| 339 | 'defines': [ |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 340 | # This tells clang's optimizer the same thing. |
Brian Silverman | bbeed50 | 2014-08-14 23:19:15 -0700 | [diff] [blame] | 341 | '__builtin_assume_aligned(p, a)=({ const typeof(p) my_p_ = (p); ((((uintptr_t)my_p_ % (a)) == 0u) ? my_p_ : (__builtin_unreachable(), (my_p_))); })', |
Brian Silverman | 79723eb | 2014-04-21 22:05:11 -0700 | [diff] [blame] | 342 | ], |
| 343 | }, |
| 344 | ], |
| 345 | ], |
brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame] | 346 | } |
| 347 | ] |
| 348 | ], |
| 349 | }, |
| 350 | } |