forked from alljoyn/core-alljoyn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
107 lines (85 loc) · 4.27 KB
/
SConstruct
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Copyright (c) Open Connectivity Foundation (OCF), AllJoyn Open Source
# Project (AJOSP) Contributors and others.
#
# SPDX-License-Identifier: Apache-2.0
#
# All rights reserved. This program and the accompanying materials are
# made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Copyright (c) Open Connectivity Foundation and Contributors to AllSeen
# Alliance. All rights reserved.
#
# Permission to use, copy, modify, and/or distribute this software for
# any purpose with or without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
# DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
# PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
# TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
import os
# Get the global environment
env = SConscript(['build_core/SConscript'])
vars = Variables()
vars.Add('BINDINGS', 'Bindings to build (comma separated list): cpp, c, java, js', 'cpp,c,java,js')
vars.Add('SERVICES', 'AllJoyn services libraries to build (comma separated list): config,controlpanel,notification,onboarding,time,audio', '')
vars.Add(EnumVariable('BUILD_SERVICES_SAMPLES', 'Build the services samples that require libxml2 and json libraries.', 'on', allowed_values = ['on', 'off']))
vars.Add(BoolVariable('BUILD_DDAPI', 'Flag to indicate if data-driven API has to be built or not', 0))
vars.Update(env)
Help(vars.GenerateHelpText(env))
bindings = set([ b.strip()
for b in env['BINDINGS'].split(',')
if b.strip() == 'cpp' or os.path.exists('alljoyn_%s/SConscript' % b.strip()) ])
services = set([ s.strip()
for s in env['SERVICES'].split(',')
if os.path.exists('../../services/base/%s/SConscript' % s.strip())])
print 'Building bindings: %s' % ', '.join(bindings)
print 'Building services: %s' % ', '.join(services)
env['bindings'] = bindings
env['services'] = services
# Always build AllJoyn Core
env.SConscript(['alljoyn_core/SConscript'])
if 'c' in bindings:
env.SConscript(['alljoyn_c/SConscript'])
if 'java' in bindings:
env.SConscript(['alljoyn_java/SConscript'])
if 'js' in bindings:
env.SConscript(['alljoyn_js/SConscript'])
# Always build AboutService and ConfigService.
env.SConscript(['services/about/SConscript'])
env.SConscript(['services/config/SConscript'])
if services.intersection(['controlpanel', 'notification', 'onboarding', 'time', 'audio']):
env['APP_COMMON_DIR'] = env.Dir('../../services/base/sample_apps')
if services.intersection(['controlpanel', 'notification']):
# controlpanel also depends on notification
env.SConscript(['../../services/base/notification/SConscript'])
if 'controlpanel' in services:
env.SConscript(['../../services/base/controlpanel/SConscript'])
if 'onboarding' in services:
env.SConscript(['../../services/base/onboarding/SConscript'])
if 'time' in services:
env.SConscript(['../../services/base/time/SConscript'])
if 'audio' in services:
env.SConscript(['../../services/audio/SConscript'])
if env['BUILD_SERVICES_SAMPLES'] == 'on':
env.SConscript(['../../services/base/sample_apps/SConscript'])
#Build Win7 SDK installer
if env.has_key('WIN7_MSI') and env['WIN7_MSI'] == 'true':
win7Sdk = env.SConscript(['alljoyn_core/install/Win7/SConscript'])
env.Depends(win7Sdk, installedFiles)
# Always build Datadriven_api if it is present
if env['BUILD_DDAPI'] == 1:
if os.path.exists('../../data/datadriven_api/SConscript'):
env.SConscript(['../../data/datadriven_api/SConscript'])
# Build Alias to make cleaning, building and rebuilding the documentation when
# working only on the documentation simpler. This can be run by using
# `scons all_docs`
env.Alias('all_docs', ['core_docs', 'c_docs'])