OLD | NEW |
| (Empty) |
1 #! -*- python -*- | |
2 # | |
3 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | |
4 # Use of this source code is governed by a BSD-style license that can be | |
5 # found in the LICENSE file. | |
6 | |
7 import make_nacl_env | |
8 import os | |
9 import sys | |
10 | |
11 ROOT_DIR = os.getenv('NACL_SDK_ROOT') | |
12 | |
13 sys.path.append(ROOT_DIR) | |
14 from build_tools import build_utils | |
15 | |
16 nacl_env = make_nacl_env.NaClEnvironment( | |
17 use_c_plus_plus_libs=True, nacl_platform=os.getenv('NACL_TARGET_PLATFORM')) | |
18 nacl_env.Append( | |
19 # Add a CPPPATH that enables the full-path #include directives, such as | |
20 # #include "examples/sine_synth/sine_synth.h" | |
21 CPPPATH=[ | |
22 os.path.dirname(os.path.dirname(os.getcwd())), | |
23 os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))), | |
24 os.path.join(ROOT_DIR, 'third_party'), | |
25 build_utils.JoinPathToNaClRepo(root_dir=ROOT_DIR), | |
26 ROOT_DIR, | |
27 ], | |
28 # Strict ANSI compliance. | |
29 EXTRA_CCFLAGS=['-pedantic'], | |
30 ) | |
31 | |
32 sources = [ | |
33 'algorithms.cc', | |
34 'graph.cc', | |
35 'parser.cc', | |
36 'taskmap.cc', | |
37 'webgtt.cc', | |
38 ] | |
39 nacl_env.Install(dir='.', source=[os.path.join('..', '..', source) | |
40 for source in sources]) | |
41 | |
42 nacl_env.AllNaClModules(sources, 'webgtt') | |
43 | |
44 # Copy the files required by the test to the staging directory where the browser | |
45 # test can find them. See test.scons under this directory. | |
46 | |
47 webgtt_files = ['webgtt_test.html', 'webgtt_test.js', 'webgtt.nmf', | |
48 'webgtt_x86_32.nexe', 'webgtt_x86_64.nexe'] | |
49 | |
50 nacltest_js = build_utils.JoinPathToNaClRepo('native_client', | |
51 'tools', | |
52 'browser_tester', | |
53 'browserdata', | |
54 'nacltest.js', | |
55 root_dir=ROOT_DIR) | |
56 | |
57 STAGING_DIR = os.path.join(ROOT_DIR, 'scons-out', 'build', 'staging') | |
58 | |
59 stage_install = nacl_env.Install(dir=STAGING_DIR, | |
60 source=webgtt_files+[nacltest_js]) | |
61 | |
62 Alias('stage', stage_install) | |
OLD | NEW |