OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 | 2 |
3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 3 # Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import glob | 7 import glob |
8 import os | 8 import os |
9 | 9 |
10 env = Environment() | 10 env = Environment() |
11 | 11 |
12 lib_sources = env.Split("""env.cc | 12 lib_sources = env.Split("""env.cc |
13 interface.cc | 13 interface.cc |
14 minijail.cc | 14 minijail.cc |
15 options.cc""") | 15 options.cc""") |
16 bin_sources = env.Split("""minijail_main.cc""") | 16 bin_sources = env.Split("""minijail_main.cc""") |
17 test_sources = env.Split("""minijail_unittest.cc | 17 test_sources = env.Split("""minijail_unittest.cc |
| 18 options_unittest.cc |
18 minijail_testrunner.cc""") | 19 minijail_testrunner.cc""") |
19 benchmark_sources = glob.glob("*_microbenchmark.cc") | 20 benchmark_sources = glob.glob("*_microbenchmark.cc") |
20 | 21 |
21 env.Append( | 22 env.Append( |
22 CPPPATH=['..', '../../third_party/chrome/files', '../../common'], | 23 CPPPATH=['..', '../../third_party/chrome/files', '../../common'], |
23 CCFLAGS=['-g', '-fno-exceptions', '-Wall', '-Werror'], | 24 CCFLAGS=['-g', '-fno-exceptions', '-Wall', '-Werror'], |
24 LIBPATH=['../../third_party/chrome'], | 25 LIBPATH=['../../third_party/chrome'], |
25 LIBS=['cap', 'base', 'pthread', 'rt'], | 26 LIBS=['cap', 'base', 'pthread', 'rt'], |
26 ) | 27 ) |
27 for key in Split('CC CXX AR RANLIB LD NM CFLAGS CCFLAGS'): | 28 for key in Split('CC CXX AR RANLIB LD NM CFLAGS CCFLAGS'): |
28 value = os.environ.get(key) | 29 value = os.environ.get(key) |
29 if value != None: | 30 if value != None: |
30 env[key] = value | 31 env[key] = value |
31 | 32 |
32 env_lib = env.Clone() | 33 env_lib = env.Clone() |
33 env_lib.SharedLibrary('minijail', lib_sources) | 34 env_lib.SharedLibrary('minijail', lib_sources) |
34 | 35 |
35 env_bin = env.Clone() | 36 env_bin = env.Clone() |
36 env_bin.Program('minijail', lib_sources + bin_sources) | 37 env_bin.Program('minijail', lib_sources + bin_sources) |
37 | 38 |
38 env_test = env.Clone() | 39 env_test = env.Clone() |
39 env_test.Append(LIBS=['gtest']) | 40 env_test.Append(LIBS=['gtest', 'gmock']) |
40 env_test.Program('minijail_unittests', lib_sources + test_sources) | 41 env_test.Program('minijail_unittests', lib_sources + test_sources) |
41 | 42 |
42 env_benchmarks = env.Clone() | 43 env_benchmarks = env.Clone() |
43 # Note, LIBS needs to have: 'gtest', 'base', 'rt', 'pthread' | 44 # Note, LIBS needs to have: 'gtest', 'base', 'rt', 'pthread' |
44 env_benchmarks.Append(LIBS=['microbenchmark_main.a', | 45 env_benchmarks.Append(LIBS=['microbenchmark_main.a', |
45 # Since we want to run this on a prod image, | 46 # Since we want to run this on a prod image, |
46 # we just statically pull in gtest.a. | 47 # we just statically pull in gtest.a. |
47 File('/usr/lib/libgtest.a')], | 48 File('/usr/lib/libgtest.a')]) |
48 LIBPATH=['../microbenchmark']) | |
49 env_benchmarks.Program('minijail_benchmarks', benchmark_sources) | 49 env_benchmarks.Program('minijail_benchmarks', benchmark_sources) |
OLD | NEW |