build_sample = env.get('BUILD_SAMPLE')
with_ra = env.get('WITH_RA')
with_tcp = env.get('WITH_TCP')
+disable_tcp_server = env.get('DISABLE_TCP_SERVER')
+disable_ble_server = env.get('DISABLE_BLE_SERVER')
+with_mq = env.get('WITH_MQ')
+ble_custom_adv = env.get('BLE_CUSTOM_ADV')
print "Given Transport is %s" % transport
print "Given OS is %s" % target_os
print "BUILD_SAMPLE is %s" % build_sample
+print "MQ flag is %s" % with_mq
targets_disallow_multitransport = ['arduino']
env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
if with_tcp == True:
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
- if target_os == 'linux':
+ if disable_tcp_server == True:
+ env.AppendUnique(CPPDEFINES = ['DISABLE_TCP_SERVER'])
+ if disable_ble_server == True:
+ if target_os in ['tizen']:
+ env.AppendUnique(CPPDEFINES = ['DISABLE_BLE_SERVER'])
+ if target_os in ['linux']:
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','LE_ADAPTER'])
elif target_os == 'tizen':
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
+ elif target_os == 'android':
+ env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER', 'NFC_ADAPTER'])
elif target_os in['darwin','ios']:
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','NO_LE_ADAPTER'])
+ elif target_os in ['msys_nt', 'windows']:
+ env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','NO_LE_ADAPTER'])
else:
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
print "CA Transport is ALL"
else:
if 'BT' in transport:
- if target_os == 'linux':
+ if target_os in ['linux']:
print "CA Transport BT is not supported in Linux"
Exit(1)
else:
if 'BLE' in transport:
env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
print "CA Transport is BLE"
+ if ble_custom_adv in ['True']:
+ env.AppendUnique(CPPDEFINES = ['BLE_CUSTOM_ADVERTISE'])
+ print "BLE Custom advertisement supported"
+ else:
+ print "BLE Custom advertisement not supported"
+ if disable_ble_server == True:
+ if target_os in ['tizen']:
+ env.AppendUnique(CPPDEFINES = ['DISABLE_BLE_SERVER'])
+ print "BLE Server Disabled"
else:
env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
if with_tcp == True:
- if target_os in ['linux', 'tizen', 'android']:
+ if target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'tizenrt']:
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
print "CA Transport is TCP"
else:
else:
env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
-env.SConscript('./src/SConscript')
+ if disable_tcp_server == True:
+ if target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'tizenrt']:
+ env.AppendUnique(CPPDEFINES = ['DISABLE_TCP_SERVER'])
-if build_sample == 'ON':
- if target_os in ['linux', 'arduino', 'darwin']:
- target_path = target_os
+ if 'NFC' in transport:
+ if target_os in['android']:
+ env.AppendUnique(CPPDEFINES = ['NFC_ADAPTER'])
+ print "CA Transport is NFC"
+ else:
+ print "CA Transport NFC is not supported "
+ Exit(1)
+ else:
+ env.AppendUnique(CPPDEFINES = ['NO_NFC_ADAPTER'])
- if target_os == 'darwin':
- target_path = 'linux'
- env.SConscript('./samples/' + target_path + '/SConscript')
+if 'SUB' in with_mq:
+ env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
+ print "MQ SUB support"
- elif target_os in ['android']:
- env.SConscript('./samples/' + target_os + '/SConscript')
+if 'PUB' in with_mq:
+ env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
+ print "MQ PUB support"
- #to build sample apk, uncomment below line after ca libraries are built
- #while building ca libraries comment the below line, to avoid build errors
+if 'BROKER' in with_mq:
+ env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
+ print "MQ Broker support"
- #env.SConscript('./samples/' + target_os + '/casample/SConscript')
+env.SConscript('./src/SConscript')