2 # The main build script
8 # List of targets that only support the IoTivity C SDK.
9 targets_csdk_only = ['arduino','darwin','ios']
11 # Load common build config
12 SConscript('build_common/SConscript', exports = 'targets_csdk_only')
16 target_os = env.get('TARGET_OS')
18 if target_os not in targets_csdk_only:
20 env.PrepareLib('cereal')
21 env.PrepareLib('expat')
22 env.PrepareLib('boost', 'boost_thread', os.path.join(env.get('SRC_DIR'), 'extlibs', 'boost'))
23 env.PrepareLib('boost', 'boost_system', os.path.join(env.get('SRC_DIR'), 'extlibs', 'boost'))
25 if target_os == 'arduino':
26 SConscript('arduino.scons')
28 # By default, src_dir is current dir, the build_dir is:
29 # ./out/<target_os>/<target_arch>/<release or debug>/
31 # The build_dir is a variant directory of the source directory(You can
32 # consider build_dir as a soft link to src_dir, for detail please refer to:
33 # http://www.scons.org/doc/production/HTML/scons-user.html#f-VariantDir
35 # Any way, to make the output is in build_dir, when load scripts, the path should
36 # be relevant to build_dir.
37 build_dir = env.get('BUILD_DIR')
39 # Build 'resource' sub-project
40 SConscript(os.path.join(build_dir, 'resource', 'SConscript'),
41 exports = 'targets_csdk_only')
43 # Build 'service' sub-project
44 SConscript(os.path.join(build_dir, 'service', 'SConscript'),
45 exports = 'targets_csdk_only')
47 # Append targets information to the help information, to see help info, execute command line:
51 # Print bin upload command line (arduino only)
52 if target_os == 'arduino':