Commit eb27e53b authored by Pawel Winogrodzki's avatar Pawel Winogrodzki Committed by Ashok Babu Channa

IOT-1583: Preparing connectivity scons script for /W3 changes (part 1).

First batch of changes connectivity scons scripts to allow
enabling of /W3 level warnings for the connectivity directory
only.

This change makes sure the connectivity Environment variable
is separated from the global "env", so it only modifies the way
connectivity is built.

Change-Id: I76e9f742bb462b8b9dd6c5c26e07d9c553d70446
Signed-off-by: default avatarPawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/17367Tested-by: default avatarjenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: default avatarDan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: default avatarAshok Babu Channa <ashok.channa@samsung.com>
parent c7089e2b
......@@ -374,6 +374,126 @@ pc_vars = {
env.Substfile(pc_file, SUBST_DICT = pc_vars)
######################################################################
# Setting global CPPDEFINES
######################################################################
target_transport = env.get('TARGET_TRANSPORT')
with_mq = env.get('WITH_MQ')
with_ra = env.get('WITH_RA')
with_tcp = env.get('WITH_TCP')
rd_mode = env.get('RD_MODE')
with_ra_ibb = env.get('WITH_RA_IBB')
if (env.get('WITH_UPSTREAM_LIBCOAP') == '1'):
env.AppendUnique(CPPDEFINES = ['WITH_UPSTREAM_LIBCOAP'])
if (target_os not in ['arduino', 'windows']):
env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
if (target_os in ['darwin','ios']):
env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
if (env.get('SECURED') == '1'):
env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
if ((env.get('SECURED') == '1') and with_tcp):
env.AppendUnique(CPPDEFINES = ['__WITH_TLS__'])
if (env.get('MULTIPLE_OWNER') == '1'):
env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
if (env.get('ROUTING') == 'GW'):
env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
elif (env.get('ROUTING') == 'EP'):
env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
if (target_os == 'arduino'):
env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO'])
elif (('IP' in target_transport) or ('ALL' in target_transport)):
env.AppendUnique(CPPDEFINES = ['WITH_BWT'])
if (target_os in ['linux', 'tizen', 'android'] and with_tcp):
env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
if (target_os in ['linux', 'tizen', 'android', 'arduino', 'ios']):
if (('BLE' in target_transport) or ('BT' in target_transport) or ('ALL' in target_transport)):
env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
if 'ALL' in target_transport:
if with_ra:
env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
if with_tcp:
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
if (target_os in ['linux']):
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'NO_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', 'msys_nt', 'windows']):
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'NO_EDR_ADAPTER', 'NO_LE_ADAPTER'])
else:
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER', 'EDR_ADAPTER', 'LE_ADAPTER'])
else:
if ('BT' in target_transport):
if (target_os == 'linux'):
print "CA Transport BT is not supported "
Exit(1)
else:
env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER'])
else:
env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
if ('BLE' in target_transport):
env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
else:
env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
if ('IP' in target_transport):
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
else:
env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
if with_tcp:
if (target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'windows']):
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
else:
print "CA Transport TCP is not supported "
Exit(1)
else:
env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
if ('NFC' in target_transport):
if (target_os == 'android'):
env.AppendUnique(CPPDEFINES = ['NFC_ADAPTER'])
else:
print "CA Transport NFC is not supported "
Exit(1)
else:
env.AppendUnique(CPPDEFINES = ['NO_NFC_ADAPTER'])
if ('SUB' in with_mq):
env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
if ('PUB' in with_mq):
env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
if ('BROKER' in with_mq):
env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
if env.get('LOGGING'):
env.AppendUnique(CPPDEFINES = ['TB_LOG'])
if env.get('WITH_CLOUD') and with_tcp:
env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
if 'CLIENT' in rd_mode:
env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
if 'SERVER' in rd_mode:
env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
if with_ra_ibb:
env.AppendUnique(CPPDEFINES = ['RA_ADAPTER_IBB'])
######################################################################
# Link scons to Yocto cross-toolchain ONLY when target_os is yocto
######################################################################
......@@ -427,9 +547,7 @@ if target_os == "yocto":
'''
if env.get('RELEASE'):
env.AppendUnique(CPPDEFINES = ['NDEBUG'])
if env.get('LOGGING'):
env.AppendUnique(CPPDEFINES = ['TB_LOG'])
env.AppendUnique(CPPDEFINES = ['WITH_POSIX', '__linux__', '_GNU_SOURCE'])
env.AppendUnique(CPPDEFINES = ['__linux__', '_GNU_SOURCE'])
env.AppendUnique(CFLAGS = ['-std=gnu99'])
env.AppendUnique(CCFLAGS = ['-Wall', '-Wextra', '-fPIC'])
env.AppendUnique(LIBS = ['dl', 'pthread', 'uuid'])
......
......@@ -32,23 +32,24 @@ cc_sample_app_env = lib_env.Clone()
# Build flags
######################################################################
# For bring up purposes only, the forked version will live here.
cc_sample_app_env.AppendUnique(CPPPATH = ['../../../resource/csdk/connectivity/lib/libcoap-4.1.1/include',
'../../../extlibs/mbedtls/mbedtls/include'])
cc_sample_app_env.AppendUnique(CPPPATH = ['#/resource/csdk/connectivity/lib/libcoap-4.1.1/include',
'#/extlibs/mbedtls/mbedtls/include'])
cc_sample_app_env.AppendUnique(CPPPATH = [
'../../../resource/include/',
'../../../resource/csdk/resource-directory/include',
'../../../resource/csdk/include',
'../../../resource/csdk/stack/include',
'../../../resource/c_common/ocrandom/include',
'../../../resource/csdk/logger/include',
'../../../resource/oc_logger/include',
'../../../resource/csdk/connectivity/inc',
'../../../resource/csdk/connectivity/api',
'../../../resource/csdk/connectivity/common/inc',
'../../../resource/csdk/security/provisioning/include',
'../../../resource/csdk/security/provisioning/include/internal'
'#/resource/include/',
'#/resource/csdk/resource-directory/include',
'#/resource/csdk/include',
'#/resource/csdk/stack/include',
'#/resource/c_common/ocrandom/include',
'#/resource/csdk/logger/include',
'#/resource/oc_logger/include',
'#/resource/csdk/connectivity/inc',
'#/resource/csdk/connectivity/api',
'#/resource/csdk/connectivity/common/inc',
'#/resource/csdk/security/include',
'#/resource/csdk/security/provisioning/include',
'#/resource/csdk/security/provisioning/include/internal'
])
cc_sample_app_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra', '-std=c++0x', '-pthread'])
......
......@@ -65,7 +65,7 @@ if target_os not in ['windows', 'winrt']:
jni_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
jni_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
jni_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction'])
jni_env.PrependUnique(LIBS = ['resource_directory', 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction'])
if env.get('SECURED') == '1':
jni_env.AppendUnique(CPPDEFINES= ['__WITH_TLS__'])
jni_env.PrependUnique(LIBS = ['mbedtls', 'ocprovision', 'ocpmapi'])
......
......@@ -48,6 +48,7 @@ env.PrependUnique(CPPPATH = [ os.path.join(src_dir, 'resource', 'c_common', 'oic
os.path.join(src_dir, 'resource', 'oc_logger', 'include'),
os.path.join(src_dir, 'resource', 'csdk', 'logger', 'include'),
os.path.join(src_dir, 'resource', 'csdk', 'stack', 'include'),
os.path.join(src_dir, 'resource', 'csdk', 'security', 'include'),
os.path.join(src_dir, 'resource', 'csdk', 'include')
])
env.AppendUnique(CPPPATH = [ os.path.join(pi_path, 'include'),
......
......@@ -4,12 +4,13 @@
Import('env')
target_os = env.get('TARGET_OS')
transport = env.get('TARGET_TRANSPORT')
build_sample = env.get('BUILD_SAMPLE')
with_ra = env.get('WITH_RA')
with_tcp = env.get('WITH_TCP')
with_mq = env.get('WITH_MQ')
connectivity_env = env.Clone()
target_os = connectivity_env.get('TARGET_OS')
transport = connectivity_env.get('TARGET_TRANSPORT')
build_sample = connectivity_env.get('BUILD_SAMPLE')
with_ra = connectivity_env.get('WITH_RA')
with_tcp = connectivity_env.get('WITH_TCP')
with_mq = connectivity_env.get('WITH_MQ')
print "Given Transport is %s" % transport
print "Given OS is %s" % target_os
......@@ -24,77 +25,4 @@ if target_os in targets_disallow_multitransport:
print "%s disallowed until testing can validate use of multiple transports on %s %d" % (transport, target_os, len(transport))
Exit(1)
if 'ALL' in transport:
if with_ra == True:
env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
if with_tcp == True:
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
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 in ['linux']:
print "CA Transport BT is not supported in Linux"
Exit(1)
else:
env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER'])
print "CA Transport is BT"
else:
env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
if 'BLE' in transport:
env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
print "CA Transport is BLE"
else:
env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
if 'IP' in transport:
env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
print "CA Transport is IP"
else:
env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
if with_tcp == True:
if target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'windows']:
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
print "CA Transport is TCP"
else:
print "CA Transport TCP is not supported "
Exit(1)
else:
env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
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 'SUB' in with_mq:
env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
print "MQ SUB support"
if 'PUB' in with_mq:
env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
print "MQ PUB support"
if 'BROKER' in with_mq:
env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
print "MQ Broker support"
env.SConscript('./src/SConscript')
SConscript('src/SConscript', exports = 'connectivity_env')
##
# CA build script
##
import os
Import('env')
Import('connectivity_env')
print "Reading common folder script"
ca_os = env.get('TARGET_OS')
src_dir = env.get('SRC_DIR')
root_dir = './../'
target_os = connectivity_env.get('TARGET_OS')
src_dir = os.path.abspath(os.curdir)
ca_common_path = root_dir + 'common/'
ca_common_src_path = ca_common_path + 'src/'
env.AppendUnique(CPPPATH = [
'#resource/c_common/octhread/include/',
'common/inc/',
src_dir + '/resource/csdk/logger/include/',
])
connectivity_env.AppendUnique(CPPPATH = [
'#resource/c_common/octhread/include/',
'#resource/csdk/connectivity/common/inc/',
'#resource/csdk/logger/include/',
])
######################################################################
# Source files and Target(s)
# Source files
######################################################################
ca_common_src_path = os.path.join(src_dir, 'src')
ca_common_src = [
ca_common_src_path + 'uarraylist.c',
ca_common_src_path + 'ulinklist.c',
ca_common_src_path + 'uqueue.c',
ca_common_src_path + 'caremotehandler.c'
]
os.path.join(ca_common_src_path, 'uarraylist.c'),
os.path.join(ca_common_src_path, 'ulinklist.c'),
os.path.join(ca_common_src_path, 'uqueue.c'),
os.path.join(ca_common_src_path, 'caremotehandler.c')
]
if env['POSIX_SUPPORTED'] or ca_os in ['windows']:
platform_src = [
ca_common_src_path + 'cathreadpool_pthreads.c',
]
else:
platform_src = []
if connectivity_env['POSIX_SUPPORTED'] or target_os in ['windows']:
ca_common_src.append(os.path.join(ca_common_src_path, 'cathreadpool_pthreads.c'))
env.AppendUnique(CA_SRC = ca_common_src)
env.AppendUnique(CA_SRC = platform_src)
connectivity_env.AppendUnique(CA_SRC = ca_common_src)
......@@ -3,16 +3,16 @@
##
import os.path
Import('env')
ca_os = env.get('TARGET_OS')
ca_transport = env.get('TARGET_TRANSPORT')
secured = env.get('SECURED')
multiple_owner = env.get('MULTIPLE_OWNER')
with_ra = env.get ('WITH_RA')
with_ra_ibb = env.get('WITH_RA_IBB')
with_tcp = env.get('WITH_TCP')
src_dir = env.get('SRC_DIR')
Import('connectivity_env')
ca_os = connectivity_env.get('TARGET_OS')
ca_transport = connectivity_env.get('TARGET_TRANSPORT')
secured = connectivity_env.get('SECURED')
multiple_owner = connectivity_env.get('MULTIPLE_OWNER')
with_ra = connectivity_env.get ('WITH_RA')
with_ra_ibb = connectivity_env.get('WITH_RA_IBB')
with_tcp = connectivity_env.get('WITH_TCP')
src_dir = connectivity_env.get('SRC_DIR')
root_dir = os.pardir
ca_path = os.curdir
......@@ -22,82 +22,60 @@ ca_path = os.curdir
print"Reading ca script %s"%ca_transport
env.PrependUnique(CPPPATH = [ os.path.join(root_dir, 'api') ])
connectivity_env.PrependUnique(CPPPATH = [ os.path.join(root_dir, 'api') ])
with_upstream_libcoap = env.get('WITH_UPSTREAM_LIBCOAP')
with_upstream_libcoap = connectivity_env.get('WITH_UPSTREAM_LIBCOAP')
if with_upstream_libcoap == '1':
# For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded.
env.AppendUnique(CPPPATH = [os.path.join('#extlibs', 'libcoap', 'libcoap', 'include')])
env.AppendUnique(CPPDEFINES = ['WITH_UPSTREAM_LIBCOAP'])
connectivity_env.AppendUnique(CPPPATH = [os.path.join('#extlibs', 'libcoap', 'libcoap', 'include')])
else:
# For bring up purposes only, the forked version will live here.
env.AppendUnique(CPPPATH = [ os.path.join('#resource', 'csdk', 'connectivity', 'lib', 'libcoap-4.1.1', 'include')])
connectivity_env.AppendUnique(CPPPATH = [ os.path.join('#resource', 'csdk', 'connectivity', 'lib', 'libcoap-4.1.1', 'include')])
env.AppendUnique(CPPPATH = [ os.path.join(root_dir, 'inc'),
connectivity_env.AppendUnique(CPPPATH = [ os.path.join(root_dir, 'inc'),
os.path.join(src_dir, 'resource', 'csdk', 'logger', 'include'),
os.path.join(root_dir, 'common', 'inc'),
os.path.join(root_dir, 'util', 'inc') ])
if ca_os not in ['arduino', 'windows']:
env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
if ca_os not in ['darwin', 'ios', 'windows']:
env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
if ca_os in ['darwin','ios']:
env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
connectivity_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
# Getting common source files
env.SConscript(os.path.join(root_dir, 'common', 'SConscript'))
connectivity_env.SConscript(os.path.join(root_dir, 'common', 'SConscript'), exports = 'connectivity_env')
# Getting util source files
env.SConscript(os.path.join(root_dir, 'util', 'SConscript'))
connectivity_env.SConscript(os.path.join(root_dir, 'util', 'SConscript'), exports = 'connectivity_env')
build_dir = env.get('BUILD_DIR')
build_dir = connectivity_env.get('BUILD_DIR')
env.AppendUnique(CA_SRC = [os.path.join(ca_path,
connectivity_env.AppendUnique(CA_SRC = [os.path.join(ca_path,
'adapter_util/caadapterutils.c')])
if (('BLE' in ca_transport) or ('ALL' in ca_transport)):
env.AppendUnique(CA_SRC = [os.path.join(ca_path,
connectivity_env.AppendUnique(CA_SRC = [os.path.join(ca_path,
'adapter_util/cafragmentation.c')])
if env.get('SECURED') == '1':
env.AppendUnique(CPPPATH = ['#extlibs/timer'])
env.AppendUnique(CPPPATH = [src_dir + '/resource/csdk/security/include'])
env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'external/inc')])
if connectivity_env.get('SECURED') == '1':
connectivity_env.AppendUnique(CPPPATH = ['#extlibs/timer'])
connectivity_env.AppendUnique(CPPPATH = [src_dir + '/resource/csdk/security/include'])
connectivity_env.AppendUnique(CPPPATH = [os.path.join(root_dir, 'external/inc')])
tls_path = 'extlibs/mbedtls';
tls_headers_path = 'mbedtls/include';
if ca_os == 'tizen' and os.path.exists(root_dir + '/' + tls_path):
env.SConscript(os.path.join(root_dir, tls_path + '/SConscript'))
env.AppendUnique(CPPPATH = [os.path.join(root_dir, tls_path + '/' + tls_headers_path)])
connectivity_env.SConscript(os.path.join(root_dir, tls_path + '/SConscript'))
connectivity_env.AppendUnique(CPPPATH = [os.path.join(root_dir, tls_path + '/' + tls_headers_path)])
else:
if ca_os != 'android':
env.SConscript('#' + tls_path + '/SConscript')
env.AppendUnique(CPPPATH = ['#' + tls_path + '/' + tls_headers_path])
env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'adapter_util/ca_adapter_net_ssl.c')])
if ((secured == '1') and (with_tcp == True)):
env.AppendUnique(CPPDEFINES = ['__WITH_TLS__'])
if (multiple_owner == '1'):
env.AppendUnique(CPPDEFINES=['MULTIPLE_OWNER'])
connectivity_env.SConscript('#' + tls_path + '/SConscript')
connectivity_env.AppendUnique(CPPPATH = ['#' + tls_path + '/' + tls_headers_path])
connectivity_env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'adapter_util/ca_adapter_net_ssl.c')])
ca_common_src = None
if with_ra_ibb:
env.SConscript('#extlibs/wksxmppxep/SConscript')
if env.get('ROUTING') == 'GW':
env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
elif env.get('ROUTING') == 'EP':
env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
connectivity_env.SConscript('#extlibs/wksxmppxep/SConscript')
if ca_os == 'arduino':
env.AppendUnique(CPPDEFINES = ['SINGLE_THREAD'])
env.AppendUnique(CPPDEFINES = ['WITH_ARDUINO'])
print "setting WITH_ARDUINO"
ca_common_src = [
'caconnectivitymanager.c',
......@@ -118,96 +96,81 @@ else:
'caretransmission.c',
]
if (('IP' in ca_transport) or ('ALL' in ca_transport)):
env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'cablockwisetransfer.c') ])
env.AppendUnique(CPPDEFINES = ['WITH_BWT'])
connectivity_env.AppendUnique(CA_SRC = [os.path.join(ca_path, 'cablockwisetransfer.c') ])
ca_common_src = [
os.path.join(ca_path, d) for d in ca_common_src ]
env.AppendUnique(CA_SRC = ca_common_src)
connectivity_env.AppendUnique(CA_SRC = ca_common_src)
transports = set()
if 'ALL' in ca_transport:
transports = []
if with_ra:
transports.append('ra_adapter')
if ca_os in ['linux']:
transports.append('ip_adapter')
transports.append('bt_le_adapter')
elif ca_os in ['tizen']:
transports.append('ip_adapter')
transports.append('bt_edr_adapter')
transports.append('bt_le_adapter')
elif ca_os in ['android']:
transports.append('ip_adapter')
transports.append('bt_edr_adapter')
transports.append('bt_le_adapter')
transports.append('nfc_adapter')
transports.add('ra_adapter')
if ca_os in ['linux']:
transports.add('ip_adapter')
transports.add('bt_le_adapter')
elif ca_os in ['tizen']:
transports.add('ip_adapter')
transports.add('bt_edr_adapter')
transports.add('bt_le_adapter')
elif ca_os in ['android']:
transports.add('ip_adapter')
transports.add('bt_edr_adapter')
transports.add('bt_le_adapter')
transports.add('nfc_adapter')
elif ca_os in['darwin','ios', 'msys_nt', 'windows']:
transports.append('ip_adapter')
transports.add('ip_adapter')
else:
transports.append('ip_adapter')
transports.append('bt_edr_adapter')
transports.append('bt_le_adapter')
transports.add('ip_adapter')
transports.add('bt_edr_adapter')
transports.add('bt_le_adapter')
env.SConscript(dirs = [
os.path.join(ca_path, d) for d in transports ])
connectivity_env.SConscript(dirs = [
os.path.join(ca_path, d) for d in transports ], exports = 'connectivity_env')
if 'IP' in ca_transport:
env.SConscript(os.path.join(ca_path, 'ip_adapter/SConscript'))
if ca_os == 'arduino':
if with_tcp == True:
transports = [ 'ip_adapter', 'tcp_adapter']
env.SConscript(dirs = [
os.path.join(ca_path, d) for d in transports ])
transports.add('ip_adapter')
if ca_os == 'arduino' and with_tcp:
transports.add('tcp_adapter')
if 'BT' in ca_transport:
env.SConscript(os.path.join(ca_path, 'bt_edr_adapter/SConscript'))
transports.add('bt_edr_adapter')
if 'BLE' in ca_transport:
env.SConscript(os.path.join(ca_path, 'bt_le_adapter/SConscript'))
transports.add('bt_le_adapter')
if 'NFC' in ca_transport:
env.SConscript(os.path.join(ca_path, 'nfc_adapter/SConscript'))
if ca_os in ['linux', 'tizen', 'android', 'ios', 'windows']:
if with_tcp == True:
env.SConscript(os.path.join(ca_path, 'tcp_adapter/SConscript'))
env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
if ca_os in ['linux', 'tizen', 'android', 'arduino', 'ios']:
if (('BLE' in ca_transport) or ('BT' in ca_transport) or ('ALL' in ca_transport)):
env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
transports.add('nfc_adapter')
print "Include path is %s" % env.get('CPPPATH')
print "Files path is %s" % env.get('CA_SRC')
if ca_os in ['linux', 'tizen', 'android', 'ios', 'windows'] and with_tcp:
transports.add('tcp_adapter')
lib_env = env.Clone()
lib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
SConscript(dirs = list(transports), exports='connectivity_env')
if env.get('LOGGING'):