aboutsummaryrefslogtreecommitdiff
path: root/demos/scons-embind/SConstruct
blob: 8afc3e270549fdf549e762484c1e767f99f51dd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
env = Environment(
    toolpath=['../../scons-tools'],
    tools=['cc', 'c++', 'ar', 'emscripten', 'llvm', 'closure'],
    LLVM_ROOT='/opt/local/bin',
    CLANG='clang-mp-3.2',
    CLANGXX='clang++-mp-3.2',
    LLVM_LINK='llvm-link-mp-3.2',
    LLVM_OPT='opt-mp-3.2',
    LLVM_DIS='llvm-dis-mp-3.2',
    EMSCRIPTEN_VERSION_FILE=File('build/version_file'),
    EMSCRIPTEN_SETTINGS={
        'ASM_JS': 0,
    })
env['BUILDERS']['WrapInModule'] = Builder(
    action='cp $SOURCE $TARGET',
)

env.Append()
a1 = env.Object('build/foo.bc', 'foo.cpp')
a2 = env.Object('build/bar.bc', 'bar.cpp')
total = env.LLVMLink('build/thelibrary.bc', [a1, a2])

env.emscripten('build/thelibrary.js', total)