OLD | NEW |
1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 | 6 |
7 # Protobuffer compilation | 7 # Protobuffer compilation |
8 """ Inputs: | 8 """ Inputs: |
9 target: list of targets to compile to | 9 target: list of targets to compile to |
10 source: list of sources to compile | 10 source: list of sources to compile |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 for key in Split('CFLAGS CCFLAGS CPPPATH LIBPATH'): | 87 for key in Split('CFLAGS CCFLAGS CPPPATH LIBPATH'): |
88 value = os.environ.get(key) | 88 value = os.environ.get(key) |
89 if value != None: | 89 if value != None: |
90 env[key] = Split(value) | 90 env[key] = Split(value) |
91 | 91 |
92 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH SYSROOT'): | 92 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH SYSROOT'): |
93 if os.environ.has_key(key): | 93 if os.environ.has_key(key): |
94 env['ENV'][key] = os.environ[key] | 94 env['ENV'][key] = os.environ[key] |
95 | 95 |
96 | 96 |
97 # -Wclobbered | |
98 # -Wempty-body | |
99 # -Wignored-qualifiers | |
100 # -Wtype-limits | |
101 env['CCFLAGS'] = ' '.join("""-g | 97 env['CCFLAGS'] = ' '.join("""-g |
102 -fno-exceptions | 98 -fno-exceptions |
103 -fno-strict-aliasing | 99 -fno-strict-aliasing |
104 -Wall | 100 -Wall |
105 -Wclobbered | 101 -Wclobbered |
| 102 -Wclobbered |
| 103 -Wempty-body |
106 -Wempty-body | 104 -Wempty-body |
107 -Werror | 105 -Werror |
108 -Wignored-qualifiers | 106 -Wignored-qualifiers |
| 107 -Wignored-qualifiers |
109 -Wmissing-field-initializers | 108 -Wmissing-field-initializers |
110 -Wsign-compare | 109 -Wsign-compare |
111 -Wtype-limits | 110 -Wtype-limits |
| 111 -Wtype-limits |
112 -Wuninitialized | 112 -Wuninitialized |
113 -D__STDC_FORMAT_MACROS=1 | 113 -D__STDC_FORMAT_MACROS=1 |
114 -D_FILE_OFFSET_BITS=64 | 114 -D_FILE_OFFSET_BITS=64 |
115 -I/usr/include/libxml2""".split()); | 115 -I/usr/include/libxml2""".split()); |
116 env['CCFLAGS'] += (' ' + ' '.join(env['CFLAGS'])) | 116 env['CCFLAGS'] += (' ' + ' '.join(env['CFLAGS'])) |
117 | 117 |
118 env['LIBS'] = Split("""base | 118 env['LIBS'] = Split("""base |
119 bz2 | 119 bz2 |
120 curl | 120 curl |
121 gflags | 121 gflags |
122 glib-2.0 | 122 glib-2.0 |
123 gtest | |
124 gthread-2.0 | 123 gthread-2.0 |
125 libpcrecpp | 124 libpcrecpp |
126 protobuf | 125 protobuf |
127 pthread | 126 pthread |
128 ssl | 127 ssl |
129 xml2 | 128 xml2 |
130 z""") | 129 z""") |
131 env['CPPPATH'] = ['..', '../../third_party/chrome/files', '../../common'] | 130 env['CPPPATH'] = ['..', '../../third_party/chrome/files', '../../common'] |
132 env['LIBPATH'] = ['../../third_party/chrome'] | 131 env['LIBPATH'] = ['../../third_party/chrome'] |
133 env['BUILDERS']['ProtocolBuffer'] = proto_builder | 132 env['BUILDERS']['ProtocolBuffer'] = proto_builder |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 topological_sort_unittest.cc | 208 topological_sort_unittest.cc |
210 update_check_action_unittest.cc | 209 update_check_action_unittest.cc |
211 utils_unittest.cc | 210 utils_unittest.cc |
212 zip_unittest.cc""") | 211 zip_unittest.cc""") |
213 unittest_main = ['testrunner.cc'] | 212 unittest_main = ['testrunner.cc'] |
214 | 213 |
215 client_main = ['update_engine_client.cc'] | 214 client_main = ['update_engine_client.cc'] |
216 | 215 |
217 delta_generator_main = ['generate_delta_main.cc'] | 216 delta_generator_main = ['generate_delta_main.cc'] |
218 | 217 |
219 env.Program('update_engine', sources + main) | |
220 unittest_cmd = env.Program('update_engine_unittests', | |
221 sources + unittest_sources + unittest_main) | |
222 | 218 |
223 client_cmd = env.Program('update_engine_client', sources + client_main); | 219 update_engine_core = env.Library('update_engine_core', sources) |
| 220 env.Prepend(LIBS=[update_engine_core]) |
224 | 221 |
| 222 env.Program('update_engine', main) |
| 223 |
| 224 client_cmd = env.Program('update_engine_client', client_main); |
| 225 |
| 226 delta_generator_cmd = env.Program('delta_generator', |
| 227 delta_generator_main) |
| 228 |
| 229 http_server_cmd = env.Program('test_http_server', 'test_http_server.cc') |
| 230 |
| 231 unittest_env = env.Clone() |
| 232 unittest_env.Append(LIBS=['gtest']) |
| 233 unittest_cmd = unittest_env.Program('update_engine_unittests', |
| 234 unittest_sources + unittest_main) |
225 Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + | 235 Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + |
226 Split('html app.info')) | 236 Split('html app.info')) |
227 | |
228 delta_generator_cmd = env.Program('delta_generator', | |
229 sources + delta_generator_main) | |
230 | |
231 http_server_cmd = env.Program('test_http_server', 'test_http_server.cc') | |
OLD | NEW |