7 target_os = env.get('TARGET_OS')
8 transport = env.get('TARGET_TRANSPORT')
9 build_sample = env.get('BUILD_SAMPLE')
10 with_ra = env.get('WITH_RA')
12 print "Given Transport is %s" % transport
13 print "Given OS is %s" % target_os
14 print "BUILD_SAMPLE is %s" % build_sample
16 targets_disallow_multitransport = ['arduino']
18 if target_os in targets_disallow_multitransport:
19 if ('ALL' in transport) or (len(transport) != 1):
20 print "*** Error invalid option values: TARGET_TRANSPORT"
21 print "%s disallowed until testing can validate use of multiple transports on %s %d" % (transport, target_os, len(transport))
24 if 'ALL' in transport:
26 env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
27 if target_os == 'linux':
28 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','NO_LE_ADAPTER'])
29 elif target_os == 'tizen':
30 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
31 elif target_os in['darwin','ios']:
32 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','NO_LE_ADAPTER'])
34 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
35 print "CA Transport is ALL"
38 if target_os == 'linux':
39 print "CA Transport BT is not supported in Linux"
42 env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER'])
43 print "CA Transport is BT"
45 env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
47 if 'BLE' in transport:
48 if target_os == 'linux':
49 print "CA Transport BLE is not supported in Linux"
52 env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
53 print "CA Transport is BLE"
55 env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
58 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
59 print "CA Transport is IP"
61 env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
63 env.SConscript('./src/SConscript')
65 if build_sample == 'ON':
66 if target_os in ['linux', 'arduino', 'android', 'darwin']:
67 target_path = target_os
68 if target_os == 'darwin':
70 env.SConscript('./samples/' + target_path + '/SConscript')