OLD | NEW |
(Empty) | |
| 1 # Copyright (c) 2009-2010 The Chromium OS Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import os |
| 6 import itertools |
| 7 |
| 8 |
| 9 Help('''\ |
| 10 Type: 'scons' to build and 'scons -c' to clean\ |
| 11 ''') |
| 12 |
| 13 # Create a base environment including things that are likely to be common |
| 14 # to all of the objects in this directory. We pull in overrides from the |
| 15 # environment to enable cross-compile. |
| 16 base_env = Environment() |
| 17 for key in Split('CC CXX AR RANLIB LD NM'): |
| 18 value = os.environ.get(key) |
| 19 if value != None: |
| 20 base_env[key] = value |
| 21 for key in Split('CFLAGS CCFLAGS CPPPATH LIBPATH'): |
| 22 value = os.environ.get(key) |
| 23 if value != None: |
| 24 base_env[key] = Split(value) |
| 25 |
| 26 base_env['CPPFLAGS'] = ['-D__STDC_FORMAT_MACROS'] |
| 27 |
| 28 # Fix issue with scons not passing some vars through the environment. |
| 29 for key in Split('PKG_CONFIG_LIBDIR PKG_CONFIG_PATH SYSROOT'): |
| 30 if os.environ.has_key(key): |
| 31 base_env['ENV'][key] = os.environ[key] |
| 32 |
| 33 # Build example program |
| 34 base_env.Append(LIBS=Split('Xss')) |
| 35 base_env.Append(CPPPATH=['..']) |
| 36 xidle = base_env.Library('xidle', ['xidle.cc']) |
| 37 xidle_example = base_env.Program('xidle-example', ['xidle-example.cc', xidle]) |
| 38 Default(xidle_example) |
| 39 |
| 40 # Build unit tests |
| 41 test_env = base_env.Clone() |
| 42 test_env.Append(LIBS=['gtest']) |
| 43 test_env.Program('xidle_unittest', ['testrunner.cc', 'xidle_unittest.cc', xidle]
) |
| 44 tests = [] |
OLD | NEW |