liboctbstack_env.PrependUnique(LIBS = ['ocsrm', 'coap'])
+if target_os in ['tizen']:
+ liboctbstack_env.AppendUnique(LIBS = ['pthread'])
+
if target_os in ['linux'] and liboctbstack_env.get('SIMULATOR', False):
liboctbstack_env.Append( RPATH = liboctbstack_env.Literal('\\$$ORIGIN'))
if env.get('SECURED') == '1':
- liboctbstack_env.AppendUnique(LIBS = ['tinydtls'])
liboctbstack_env.AppendUnique(LIBS = ['mbedtls','mbedx509','mbedcrypto'])
-if target_os in ['android', 'linux', 'tizen', 'msys_nt', 'windows']:
+if target_os in ['android', 'linux', 'tizen', 'msys_nt', 'windows', 'tizenrt']:
liboctbstack_env.PrependUnique(LIBS = ['connectivity_abstraction'])
if with_ra_ibb:
liboctbstack_env.Prepend(LIBS = ['routingmanager'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
- liboctbstack_env.PrependUnique(CPPPATH = ['resource-directory/include'])
- if 'CLIENT' in rd_mode:
- liboctbstack_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
- if 'SERVER' in rd_mode:
- liboctbstack_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
- if target_os in ['tizen']:
- liboctbstack_env.ParseConfig('pkg-config --cflags --libs sqlite3')
- else:
- liboctbstack_env.AppendUnique(CPPPATH = ['#extlibs/sqlite3'])
+ if 'CLIENT' in rd_mode:
+ liboctbstack_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
+ if 'SERVER' in rd_mode:
+ liboctbstack_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
+ if target_os in ['tizen']:
+ liboctbstack_env.ParseConfig('pkg-config --cflags --libs sqlite3')
+ else:
+ liboctbstack_env.AppendUnique(CPPPATH = ['#extlibs/sqlite3'])
######################################################################
# Source files and Targets
######################################################################
OCTBSTACK_SRC = 'stack/src/'
liboctbstack_src = [
- '../../extlibs/cjson/cJSON.c',
'../../extlibs/timer/timer.c',
OCTBSTACK_SRC + 'ocstack.c',
OCTBSTACK_SRC + 'ocpayload.c',
OCTBSTACK_SRC + 'oicgroup.c'
]
+if target_os != 'tizenrt':
+ liboctbstack_src.append('../../extlibs/cjson/cJSON.c')
+
if with_tcp == True:
liboctbstack_src.append(OCTBSTACK_SRC + 'oickeepalive.c')
+ liboctbstack_env.UserInstallTargetHeader('stack/include/oickeepalive.h', 'resource', 'oickeepalive.h')
if 'SERVER' in rd_mode:
- liboctbstack_src.append(OCTBSTACK_SRC + 'oicresourcedirectory.c')
- if target_os not in ['tizen']:
- liboctbstack_src.append('#extlibs/sqlite3/sqlite3.c')
+ liboctbstack_src.append(OCTBSTACK_SRC + 'oicresourcedirectory.c')
+ if target_os not in ['tizen']:
+ liboctbstack_src.append('#extlibs/sqlite3/sqlite3.c')
+
+if target_os in ['linux']:
+ # Linux uses a Shared library because SCons chooses the shared library on Linux
+ # when only 'octbstack' is added to the LIBS.
+ # TODO: Switch Linux to use a Static library for testing like every other OS.
+ test_liboctbstack = liboctbstack_env.SharedLibrary('octbstack_test', liboctbstack_src)
+else:
+ test_liboctbstack = liboctbstack_env.StaticLibrary('octbstack_test', liboctbstack_src)
+
+octbstack_libs = Flatten(test_liboctbstack)
if target_os in ['windows', 'msys_nt']:
# Avoid a name conflict with the octbstack.lib target of the SharedLibrary.
octbstack_libs = Flatten(static_liboctbstack)
-if target_os not in ['arduino','darwin','ios'] :
+if target_os not in ['arduino','darwin','ios','tizenrt'] :
shared_liboctbstack = liboctbstack_env.SharedLibrary('octbstack', liboctbstack_src)
octbstack_libs += Flatten(shared_liboctbstack)
liboctbstack_env.UserInstallTargetHeader('stack/include/ocstack.h', 'resource', 'ocstack.h')