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')
11 with_tcp = env.get('WITH_TCP')
13 print "Given Transport is %s" % transport
14 print "Given OS is %s" % target_os
15 print "BUILD_SAMPLE is %s" % build_sample
17 targets_disallow_multitransport = ['arduino']
19 if target_os in targets_disallow_multitransport:
20 if ('ALL' in transport) or (len(transport) != 1):
21 print "*** Error invalid option values: TARGET_TRANSPORT"
22 print "%s disallowed until testing can validate use of multiple transports on %s %d" % (transport, target_os, len(transport))
25 if 'ALL' in transport:
27 env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
29 env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
30 if target_os == 'linux':
31 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','LE_ADAPTER'])
32 elif target_os == 'tizen':
33 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
34 elif target_os in['darwin','ios']:
35 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','NO_LE_ADAPTER'])
37 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
38 print "CA Transport is ALL"
41 if target_os == 'linux':
42 print "CA Transport BT is not supported in Linux"
45 env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER'])
46 print "CA Transport is BT"
48 env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
50 if 'BLE' in transport:
51 env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
52 print "CA Transport is BLE"
54 env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
57 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
58 print "CA Transport is IP"
60 env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
63 if target_os in['linux']:
64 env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
65 print "CA Transport is TCP"
67 print "CA Transport TCP is not supported "
70 env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
72 env.SConscript('./src/SConscript')
74 if build_sample == 'ON':
75 if target_os in ['linux', 'arduino', 'darwin']:
76 target_path = target_os
78 if target_os == 'darwin':
80 env.SConscript('./samples/' + target_path + '/SConscript')
82 elif target_os in ['android']:
83 env.SConscript('./samples/' + target_os + '/SConscript')
85 #to build sample apk, uncomment below line after ca libraries are built
86 #while building ca libraries comment the below line, to avoid build errors
88 #env.SConscript('./samples/' + target_os + '/casample/SConscript')