summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/examples/geturl/build.scons
blob: f855644bc0a5b54175a153447b6796efb66caad2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! -*- python -*-
#
# Copyright (c) 2011 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import make_nacl_env
import os

nacl_env = make_nacl_env.NaClEnvironment(
    use_c_plus_plus_libs=True, nacl_platform=os.getenv('NACL_TARGET_PLATFORM'),
    install_subdir='geturl', lib_prefix='..')
nacl_env.Append(
    # Add a CPPPATH that enables the full-path #include directives, such as
    # #include "examples/sine_synth/sine_synth.h"
    CPPPATH=[os.path.dirname(os.path.dirname(os.getcwd()))],
    # Strict ANSI compliance.
    EXTRA_CCFLAGS=['-pedantic'],
   )

sources = ['geturl.cc', 'geturl_handler.cc']

opt_nexes, dbg_nexes = nacl_env.AllNaClModules(sources, 'geturl')

# This target is used by the SDK build system to provide a prebuilt version
# of the example in the SDK installer.
nacl_env.InstallPrebuilt('geturl')

app_files = [
    'geturl.html',
    'geturl_success.html',
    'geturl.nmf',
    ]

# Split the install of the .nexes from the other app sources so that the strip
# action is applied to the .nexes only.
install_nexes = nacl_env.NaClStrippedInstall(dir=nacl_env['NACL_INSTALL_ROOT'],
                                             source=opt_nexes)
install_app = nacl_env.Install(dir=nacl_env['NACL_INSTALL_ROOT'],
                               source=app_files)
nacl_env.Alias('install', source=install_app + install_nexes)