blob: 4cd9a9d6069c84e61c2cfa4eb8d83a1ed28e1e75 [file] [log] [blame]
brians343bc112013-02-10 01:53:46 +00001# 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
8# the .gyp file that has targets for the various external libraries
9 'EXTERNALS': '<(AOS)/build/externals.gyp',
Brian Silverman14fd0fb2014-01-14 21:42:01 -080010# the directory that gets rsynced to the target
brians343bc112013-02-10 01:53:46 +000011 'rsync_dir': '<(PRODUCT_DIR)/outputs',
12# The directory that loadable_module and shared_library targets get put into
13# There's a target_conditions that puts loadable_modules here and
14# shared_librarys automatically get put here.
15 'so_dir': '<(PRODUCT_DIR)/lib',
16# the directory that executables that depend on <(EXTERNALS):gtest get put into
17 'test_dir': '<(PRODUCT_DIR)/tests',
brians343bc112013-02-10 01:53:46 +000018 },
19 'conditions': [
20 ['OS=="crio"', {
21 'make_global_settings': [
Brian Silvermana67ecc72013-09-28 13:53:53 -070022 ['CC', '<!(readlink -f <(AOS)/build/crio_cc)'],
23 ['CXX', '<!(readlink -f <(AOS)/build/crio_cxx)'],
brians343bc112013-02-10 01:53:46 +000024 ],
brians343bc112013-02-10 01:53:46 +000025 }, {
Brian Silverman41abe012014-02-08 18:25:02 -080026 'conditions': [
27 ['PLATFORM!="linux-amd64"', {
28 'make_global_settings': [
29 ['CC', '<!(which arm-linux-gnueabihf-gcc-4.7)'],
30 ['CXX', '<!(which arm-linux-gnueabihf-g++-4.7)'],
31 ],
32 },
33 ],
Brian Silverman63cf2412013-11-17 05:44:36 -080034 ],
brians343bc112013-02-10 01:53:46 +000035 }
36 ],
37 ],
38 'target_defaults': {
39 'defines': [
40 '__STDC_FORMAT_MACROS',
41 '_FORTIFY_SOURCE=2',
Brian Silverman6137a502013-04-22 15:41:36 -070042 '__STDC_CONSTANT_MACROS',
43 '__STDC_LIMIT_MACROS',
brians343bc112013-02-10 01:53:46 +000044 ],
45 'ldflags': [
46 '-pipe',
47 ],
48 'cflags': [
49 '-pipe',
50
51 '-Wall',
52 '-Wextra',
53 '-Wswitch-enum',
54 '-Wpointer-arith',
55 '-Wstrict-aliasing=2',
56 '-Wcast-qual',
57 '-Wcast-align',
58 '-Wwrite-strings',
59 '-Wtype-limits',
60 '-Wsign-compare',
61 '-Wformat=2',
62 '-Werror',
Brian Silverman9ba2bc42013-03-17 14:18:33 -070063
64 '-ggdb3',
brians343bc112013-02-10 01:53:46 +000065 ],
66 'cflags_c': [
67 '-std=gnu99',
68 ],
brians343bc112013-02-10 01:53:46 +000069 'include_dirs': [
70 '<(DEPTH)',
71 ],
Brian Silvermand0a52dc2013-09-23 17:55:37 -070072 # These have to be here because apparently gyp evaluates target_conditions
73 # even if the target is never used.
74 'variables': {
75 # Set this to 1 to disable rsyncing the file to the target.
76 'no_rsync%': 0,
77 # Set this to 1 if this file isn't a test that should get run by
78 # `build.sh tests`.
79 'is_special_test%': 0,
80 },
brians343bc112013-02-10 01:53:46 +000081 'conditions': [
82 ['DEBUG=="yes"', {
83 'cflags': [
brians343bc112013-02-10 01:53:46 +000084 '-O0',
85 ],
brians343bc112013-02-10 01:53:46 +000086 }, {
87 'cflags': [
88 '-O3',
89 ],
Brian Silvermanefb993f2013-08-30 19:52:57 -070090 'ldflags': [
91 '-O3',
92 ],
brians343bc112013-02-10 01:53:46 +000093 'conditions': [['OS=="crio"', {
94 'cflags': [
95 '-fstrength-reduce',
96 '-fno-builtin',
97 '-fno-strict-aliasing',
98 ],
Brian Silverman41abe012014-02-08 18:25:02 -080099 }],
100 ['PLATFORM=="linux"', {
brians343bc112013-02-10 01:53:46 +0000101 'cflags': [
Brian Silvermanc4321322013-11-18 17:38:39 -0800102 '-mcpu=cortex-a8',
Brian Silverman46203612013-11-19 18:01:41 -0800103 '-mfpu=neon',
brians343bc112013-02-10 01:53:46 +0000104 ],
Brian Silverman41abe012014-02-08 18:25:02 -0800105 }],
106 ['PLATFORM=="linux-amd64"', {
107 'cflags': [
108 '-march=atom',
109 '-mfpmath=sse',
110
111 '-fstack-protector-all',
112 ],
113 }],
114 ]
brians343bc112013-02-10 01:53:46 +0000115 }
116 ],
117 ['OS=="crio"', {
118 'target_conditions': [
119 ['_type=="shared_library"', {
120 'ldflags': [
121 '-r',
122 '-nostdlib',
123 '-Wl,-X',
124 ],
125 }
126 ],
127 ],
128 'ldflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700129 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000130 '-mstrict-align',
131 '-mlongcall',
132 ],
133 'cflags': [
Brian Silverman1579fc12013-04-22 15:41:55 -0700134 # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both
135 # have MPC603e cores according to Freescale docs.
136 '-mcpu=603e',
brians343bc112013-02-10 01:53:46 +0000137 '-mstrict-align',
138 '-mlongcall',
Brian Silverman823f3242013-11-17 13:20:22 -0800139 '-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/',
140 '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/vxworks-6.3/target/h/',
141 '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/',
142 '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/',
brians343bc112013-02-10 01:53:46 +0000143 '-isystem', '<(WIND_BASE)/target/h',
144 '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
145 ],
Brian Silverman6e206682013-08-31 11:43:35 -0700146 'cflags_cc': [
147 '-std=gnu++0x',
148 ],
brians343bc112013-02-10 01:53:46 +0000149 'defines': [
150 'CPU=PPC603',
151 'TOOL_FAMILY=gnu',
152 'TOOL=gnu',
153 '_WRS_KERNEL',
154 '__PPC__',
155# This tells eigen to not do anything with alignment at all. See
156# <http://eigen.tuxfamily.org/dox/TopicPreprocessorDirectives.html> for
157# details. It really doesn't like to work without this.
158 'EIGEN_DONT_ALIGN',
159# prevent the vxworks system headers from being dumb and #defining min and max
160 'NOMINMAX',
161 ],
162 }, {
brians343bc112013-02-10 01:53:46 +0000163 'target_conditions': [
164# default to putting outputs into rsync_dir
165 ['no_rsync==0 and _type!="static_library"', {
166 'product_dir': '<(rsync_dir)',
167 },
168 ],
169 ['_type=="loadable_module"', {
170 'product_dir': '<(so_dir)',
171 }
172 ],
brians343bc112013-02-10 01:53:46 +0000173 ],
174 'ldflags': [
175 '-pthread',
brians343bc112013-02-10 01:53:46 +0000176 ],
brians343bc112013-02-10 01:53:46 +0000177 'cflags': [
178 '-pthread',
Brian Silverman6e206682013-08-31 11:43:35 -0700179
180 '-Wunused-local-typedefs',
181
182 # Give macro stack traces when they blow up.
Brian Silverman86db2a52013-09-14 15:32:25 -0700183 # TODO(brians): Re-enable this once they fix the bug where it
184 # sometimes doesn't show you the top-most (aka most useful)
185 # line of code.
186 #'-ftrack-macro-expansion',
Brian Silverman6e206682013-08-31 11:43:35 -0700187 ],
188 'cflags_cc': [
189 '-std=gnu++11',
brians343bc112013-02-10 01:53:46 +0000190 ],
191 'defines': [
Brian Silvermanefb993f2013-08-30 19:52:57 -0700192 '_FILE_OFFSET_BITS=64',
brians343bc112013-02-10 01:53:46 +0000193 ],
194 'libraries': [
195 '-lm',
196 '-lrt',
197 ],
198 }
199 ]
200 ],
201 },
202}