OLD | NEW |
1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2014 The Native Client 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 # Test file for scons_to_gn | 5 # Test file for scons_to_gn |
6 | 6 |
7 sources = ['A.c', 'B.c', 'C.c'] | 7 sources = ['A.c', 'B.c', 'C.c'] |
8 defines = [] | 8 defines = [] |
9 | 9 |
10 if env.Bit('win'): | 10 if env.Bit('win'): |
11 sources += ['win'] | 11 sources += ['win'] |
12 if env.Bit('target_x86_32'): | 12 if env.Bit('build_x86_32'): |
13 defines += ['_x86'] | 13 defines += ['_x86'] |
14 if env.Bit('target_x86_64'): | 14 if env.Bit('build_x86_64'): |
15 defines += ['_x64'] | 15 defines += ['_x64'] |
16 | 16 |
17 if True: | 17 if True: |
18 sources += ['FOOBAR.c'] | 18 sources += ['FOOBAR.c'] |
19 | 19 |
20 env.ComponentLibrary('all', sources, CFLAGS=['-D' + x for x in defines]) | 20 env.ComponentLibrary('all', sources, CFLAGS=['-D' + x for x in defines]) |
21 | 21 |
22 nacl_env = env.Clone() | 22 nacl_env = env.Clone() |
23 nacl_env.Append(CFLAGS=['-DNACL']) | 23 nacl_env.Append(CFLAGS=['-DNACL']) |
24 | 24 |
25 if nacl_env.Bit('win'): | 25 if nacl_env.Bit('win'): |
26 nacl_env.ComponentLibrary('win', sources) | 26 nacl_env.ComponentLibrary('win', sources) |
27 | 27 |
28 if env.Bit('linux'): | 28 if env.Bit('linux'): |
29 env.ComponentLibrary('linux', sources) | 29 env.ComponentLibrary('linux', sources) |
30 | 30 |
31 if env.Bit('linux'): | 31 if env.Bit('linux'): |
32 cpu_test = nacl_env.ComponentProgram('my_test', ['testing/test.c'], | 32 cpu_test = nacl_env.ComponentProgram('my_test', ['testing/test.c'], |
33 EXTRA_LIBS=['cpu_features','platform']) | 33 EXTRA_LIBS=['cpu_features','platform']) |
34 | 34 |
35 node = nacl_env.CommandTest( | 35 node = nacl_env.CommandTest( |
36 'cpu_x86_test.out', | 36 'cpu_x86_test.out', |
37 [cpu_test]) | 37 [cpu_test]) |
38 nacl_env.AddNodeToTestSuite(node, ['small_tests'], 'run_cpu_x86_test') | 38 nacl_env.AddNodeToTestSuite(node, ['small_tests'], 'run_cpu_x86_test') |
OLD | NEW |