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 import sys | 6 import sys |
7 | 7 |
8 SOURCES=['chromeos/dbus/dbus.cc', | 8 SOURCES=['chromeos/dbus/dbus.cc', |
9 'chromeos/string.cc', | 9 'chromeos/string.cc', |
10 'chromeos/utility.cc'] | 10 'chromeos/utility.cc'] |
11 | 11 |
12 env = Environment( | 12 env = Environment( |
13 CPPPATH=[ '.', '../third_party/chrome/files' ], | 13 CPPPATH=[ '.', '../third_party/chrome/files' ], |
14 CCFLAGS=['-fno-exceptions', '-fPIC'], | 14 CCFLAGS=['-fno-exceptions', '-fPIC'], |
15 ) | 15 ) |
16 for key in Split('CC CXX AR RANLIB LD NM CFLAGS CCFLAGS'): | 16 for key in Split('CC CXX AR RANLIB LD NM CFLAGS CCFLAGS'): |
17 value = os.environ.get(key) | 17 value = os.environ.get(key) |
18 if value != None: | 18 if value != None: |
19 env[key] = value | 19 env[key] = value |
20 | 20 |
21 # Fix up the pkg-config path if it is present in the environment. | 21 # Fix up the pkg-config path if it is present in the environment. |
tedbo
2010/01/08 18:03:24
Please fix up the comment as well. Could be:
# Fi
cjwatson
2010/01/08 18:57:01
Done for all files. Thanks.
| |
22 if os.environ.has_key('PKG_CONFIG_PATH'): | 22 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH'): |
23 env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH'] | 23 if os.environ.has_key(key): |
24 env['ENV'][key] = os.environ[key] | |
24 | 25 |
25 # glib and dbug environment | 26 # glib and dbug environment |
26 env.ParseConfig('pkg-config --cflags --libs dbus-1 glib-2.0 dbus-glib-1') | 27 env.ParseConfig('pkg-config --cflags --libs dbus-1 glib-2.0 dbus-glib-1') |
27 env.StaticLibrary('chromeos', SOURCES) | 28 env.StaticLibrary('chromeos', SOURCES) |
28 | 29 |
29 # Unit test | 30 # Unit test |
30 if ARGUMENTS.get('debug', 0): | 31 if ARGUMENTS.get('debug', 0): |
31 env.Append( | 32 env.Append( |
32 CCFLAGS = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline'], | 33 CCFLAGS = ['-fprofile-arcs', '-ftest-coverage', '-fno-inline'], |
33 LIBS = ['gcov'], | 34 LIBS = ['gcov'], |
(...skipping 11 matching lines...) Expand all Loading... | |
45 env_test[key] = value | 46 env_test[key] = value |
46 | 47 |
47 unittest_sources =['chromeos/glib/object_unittest.cc'] | 48 unittest_sources =['chromeos/glib/object_unittest.cc'] |
48 unittest_main = ['testrunner.cc'] | 49 unittest_main = ['testrunner.cc'] |
49 unittest_cmd = env_test.Program('unittests', | 50 unittest_cmd = env_test.Program('unittests', |
50 unittest_sources + unittest_main) | 51 unittest_sources + unittest_main) |
51 | 52 |
52 Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + | 53 Clean(unittest_cmd, Glob('*.gcda') + Glob('*.gcno') + Glob('*.gcov') + |
53 Split('html app.info')) | 54 Split('html app.info')) |
54 | 55 |
OLD | NEW |