1 #######################################################
3 #######################################################
8 print "Reading IP adapter script"
10 target_os = env.get('TARGET_OS')
11 inc_files = env.get('CPPPATH')
12 secured = env.get('SECURED')
13 src_dir = './ip_adapter/'
16 # Source files to build common for all platforms
18 if target_os == 'arduino':
19 common_files = [ os.path.join(src_dir,
23 os.path.join(src_dir, 'caipadapter.c'),
24 os.path.join(src_dir, 'caipclient.c'),
25 os.path.join(src_dir, 'caipserver.c') ]
27 # Get list of target-specific source file base names, i.e. no parent
28 # directories prepended to the path.
30 # Target-specific SConscript files are expected to return that list.
32 target_sconscript = os.path.join(target_os, 'SConscript')
34 # Check for the existence of the platform-specific SConscript file
35 # relative to the top-level source directory, not the build (variant)
36 # directory, before calling that SConscript file to prevent a missing
37 # file warning platforms that don't provide one.
38 target_sconscript_abspath = str(File(target_sconscript).srcnode().abspath)
39 if os.path.exists(target_sconscript_abspath):
40 target_files = env.SConscript(target_sconscript, exports='src_dir')
42 # Now prepend the appropriate parent directories
43 # (e.g. ./ip_adapter/android) to each of the target source files in
45 target_files = [ os.path.join(src_dir, target_os, f) for f in target_files ]
47 # Source files to build for Linux-like platforms
48 if target_os in ['linux','darwin','ios']:
49 target_files += [ os.path.join(src_dir,
50 'linux/caipnwmonitor.c') ]
52 # The list of BLE adapter source files is a combination of both the
53 # common and target-specific source file lists.
54 env.AppendUnique(CA_SRC = common_files + target_files)