replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / resource / src / SConscript
index 301e7df..79900ae 100644 (file)
@@ -33,17 +33,25 @@ secured = oclib_env.get('SECURED')
 target_os = oclib_env.get('TARGET_OS')
 with_cloud = oclib_env.get('WITH_CLOUD')
 with_mq = oclib_env.get('WITH_MQ')
+ble_custom_adv = oclib_env.get('BLE_CUSTOM_ADV')
 
 ######################################################################
 # Build flags
 ######################################################################
+with_upstream_libcoap = oclib_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.
+       oclib_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
+else:
+       # For bring up purposes only, the forked version will live here.
+       oclib_env.AppendUnique(CPPPATH = ['../csdk/connectivity/lib/libcoap-4.1.1/include'])
+
 oclib_env.AppendUnique(CPPPATH = [
                '../include/',
                '../csdk/stack/include',
                '../c_common/ocrandom/include',
                '../csdk/logger/include',
                '../oc_logger/include',
-               '../csdk/connectivity/lib/libcoap-4.1.1',
                '../csdk/connectivity/api'
                ])
 
@@ -67,6 +75,7 @@ if target_os == 'android':
 
 if target_os == 'tizen':
        oclib_env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
+if target_os in ['linux', 'tizen']:
        oclib_env.ParseConfig('pkg-config --cflags --libs sqlite3')
 
 if target_os in ['linux'] and oclib_env.get('SIMULATOR', False):
@@ -78,11 +87,14 @@ if target_os in ['msys_nt', 'windows']:
        oclib_env.AppendUnique(LIBS=['octbstack', 'logger', 'oc_logger','connectivity_abstraction', 'ocsrm', 'c_common', 'routingmanager'])
        oclib_env.AppendUnique(LIBS=[ 'coap', 'ws2_32' ,'iphlpapi'])
        if secured == '1':
-               oclib_env.AppendUnique(LIBS=['tinydtls'])
+               oclib_env.AppendUnique(LIBS=['mbedtls', 'mbedx509','mbedcrypto'])
 
 if with_cloud:
        oclib_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
 
+if ble_custom_adv == True:
+               env.AppendUnique(CPPDEFINES = ['BLE_CUSTOM_ADVERTISE'])
+
 if 'SUB' in with_mq:
        oclib_env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
 
@@ -92,11 +104,6 @@ if 'PUB' in with_mq:
 if 'BROKER' in with_mq:
        oclib_env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
 
-if 'CLIENT' in oclib_env.get('RD_MODE'):
-       oclib_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
-if 'SERVER' in oclib_env.get('RD_MODE'):
-       oclib_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
-
 ######################################################################
 # Source files and Targets
 ######################################################################
@@ -117,7 +124,7 @@ oclib_src = [
 if with_cloud:
        oclib_src = oclib_src + ['OCAccountManager.cpp']
 
-if target_os in ['windows']:
+if target_os in ['windows','ios']:
        oclib_src = oclib_src + ['OCApi.cpp']
        # TODO: Add OC_EXPORT prefixes to enable DLL generation
        oclib = oclib_env.StaticLibrary('oc', oclib_src)
@@ -159,5 +166,5 @@ if with_cloud:
        oclib_env.UserInstallTargetHeader(header_dir + 'OCAccountManager.h', 'resource', 'OCAccountManager.h')
 
 # Add Provisioning library
-if target_os in ['linux', 'android', 'tizen'] and secured == '1':
+if target_os in ['linux', 'android', 'tizen', 'ios'] and secured == '1':
         SConscript('../provisioning/SConscript')