1 ################################
3 ################################
8 target_os = env.get('TARGET_OS')
10 print "Reading BLE adapter script for", target_os
12 src_dir = os.path.join(os.curdir, 'bt_le_adapter')
14 # Source files to build common for all platforms.
16 if target_os is not 'arduino':
17 common_files = [ os.path.join(src_dir,
20 common_files = [ os.path.join(src_dir,
21 'caleadapter_singlethread.c') ]
23 # Get list of target-specific source file base names, i.e. no parent
24 # directories prepended to the path.
26 # Target-specific SConscript files are expected to return that list.
28 target_sconscript = os.path.join(target_os, 'SConscript')
30 # Check for the existence of the platform-specific SConscript file
31 # relative to the top-level source directory, not the build (variant)
32 # directory, before calling that SConscript file to prevent a missing
33 # file warning platforms that don't provide one.
34 target_sconscript_abspath = str(File(target_sconscript).srcnode().abspath)
35 if os.path.exists(target_sconscript_abspath):
36 target_files = env.SConscript(target_sconscript, exports='src_dir')
38 # Now prepend the appropriate parent directories
39 # (e.g. ./bt_le_adapter/linux) to each of the target source files in
41 target_files = [ os.path.join(src_dir, target_os, f) for f in target_files ]
43 # The list of BLE adapter source files is a combination of both the
44 # common and target-specific source file lists.
45 env.AppendUnique(CA_SRC = common_files + target_files)