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 Help('''\ | 7 Help('''\ |
8 Type: 'scons' to build and 'scons -c' to clean\ | 8 Type: 'scons' to build and 'scons -c' to clean\ |
9 ''') | 9 ''') |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 base_env = Environment() | 48 base_env = Environment() |
49 for key in Split('CC CXX AR RANLIB LD NM CFLAGS CCFLAGS'): | 49 for key in Split('CC CXX AR RANLIB LD NM CFLAGS CCFLAGS'): |
50 value = os.environ.get(key) | 50 value = os.environ.get(key) |
51 if value != None: | 51 if value != None: |
52 base_env[key] = value | 52 base_env[key] = value |
53 if not base_env.get('CCFLAGS'): | 53 if not base_env.get('CCFLAGS'): |
54 base_env['CCFLAGS'] = '-I.. -Wall -Werror -O3' | 54 base_env['CCFLAGS'] = '-I.. -Wall -Werror -O3' |
55 base_env['LINKFLAGS'] = '-lgflags -lprotobuf' | 55 base_env['LINKFLAGS'] = '-lgflags -lprotobuf' |
56 | 56 |
57 # Fix up the pkg-config path if it is present in the environment. | 57 # Fix up the pkg-config path if it is present in the environment. |
58 if os.environ.has_key('PKG_CONFIG_PATH'): | 58 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH'): |
59 base_env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH'] | 59 if os.environ.has_key(key): |
| 60 env['ENV'][key] = os.environ[key] |
60 | 61 |
61 # Unless we disable strict aliasing, we get warnings about some of the | 62 # Unless we disable strict aliasing, we get warnings about some of the |
62 # program's command line flags processing code that look like: | 63 # program's command line flags processing code that look like: |
63 # 'dereferencing type-punned pointer will break strict-aliasing rules' | 64 # 'dereferencing type-punned pointer will break strict-aliasing rules' |
64 base_env.Append(CCFLAGS=' -fno-strict-aliasing') | 65 base_env.Append(CCFLAGS=' -fno-strict-aliasing') |
65 | 66 |
66 # We include files relative to the parent directory. Let SCons know about | 67 # We include files relative to the parent directory. Let SCons know about |
67 # this so it'll recompile as needed when a header changes. | 68 # this so it'll recompile as needed when a header changes. |
68 base_env['CPPPATH'] = ['..', | 69 base_env['CPPPATH'] = ['..', |
69 '../../third_party/chrome/files', | 70 '../../third_party/chrome/files', |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 test_env.Program('shadow_test', 'shadow_test.cc') | 167 test_env.Program('shadow_test', 'shadow_test.cc') |
167 test_env.Program('stacking_manager_test', 'stacking_manager_test.cc') | 168 test_env.Program('stacking_manager_test', 'stacking_manager_test.cc') |
168 test_env.Program('util_test', 'util_test.cc') | 169 test_env.Program('util_test', 'util_test.cc') |
169 test_env.Program('window_manager_test', 'window_manager_test.cc') | 170 test_env.Program('window_manager_test', 'window_manager_test.cc') |
170 test_env.Program('window_test', 'window_test.cc') | 171 test_env.Program('window_test', 'window_test.cc') |
171 test_env.Program('x_connection_test', 'x_connection_test.cc') | 172 test_env.Program('x_connection_test', 'x_connection_test.cc') |
172 | 173 |
173 mock_chrome_env = wm_env.Clone() | 174 mock_chrome_env = wm_env.Clone() |
174 mock_chrome_env.ParseConfig('pkg-config --cflags --libs gtkmm-2.4') | 175 mock_chrome_env.ParseConfig('pkg-config --cflags --libs gtkmm-2.4') |
175 mock_chrome_env.Program('mock_chrome', 'mock_chrome.cc') | 176 mock_chrome_env.Program('mock_chrome', 'mock_chrome.cc') |
OLD | NEW |