Do not bother with C++11 check on C SDK-only platforms.
[platform/upstream/iotivity.git] / SConstruct
1 ##
2 # The main build script
3 #
4 ##
5
6 import os
7
8 # List of targets that only support the IoTivity C SDK.
9 targets_csdk_only = ['arduino']
10
11 # Load common build config
12 SConscript('build_common/SConscript', exports = 'targets_csdk_only')
13
14 Import('env')
15
16 target_os = env.get('TARGET_OS')
17 if target_os == 'arduino':
18         SConscript('arduino.scons')
19 else:
20         # Prepare libraries
21         env.PrepareLib('cereal')
22         env.PrepareLib('expat')
23         env.PrepareLib('boost', 'boost_thread', os.path.join(env.get('SRC_DIR'), 'extlibs', 'boost'))
24         env.PrepareLib('boost', 'boost_system', os.path.join(env.get('SRC_DIR'), 'extlibs', 'boost'))
25
26 # By default, src_dir is current dir, the build_dir is:
27 #     ./out/<target_os>/<target_arch>/<release or debug>/
28 #
29 # The build_dir is a variant directory of the source directory(You can
30 # consider build_dir as a soft link to src_dir, for detail please refer to:
31 #     http://www.scons.org/doc/production/HTML/scons-user.html#f-VariantDir
32 #
33 # Any way, to make the output is in build_dir, when load scripts, the path should
34 # be relevant to build_dir.
35 build_dir = env.get('BUILD_DIR')
36
37 # Build 'resource' sub-project
38 SConscript(os.path.join(build_dir, 'resource', 'SConscript'),
39            exports = 'targets_csdk_only')
40
41 # Build 'service' sub-project
42 SConscript(os.path.join(build_dir, 'service', 'SConscript'),
43            exports = 'targets_csdk_only')
44
45 # Append targets information to the help information, to see help info, execute command line:
46 #     $ scon [options] -h
47 env.PrintTargets()
48
49 # Print bin upload command line (arduino only)
50 if target_os == 'arduino':
51         env.UploadHelp()