######################################################################
with_upstream_libcoap = liboctbstack_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.
liboctbstack_env.PrependUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
else:
- # For bring up purposes only, the forked version will live here.
liboctbstack_env.PrependUnique(CPPPATH = ['#resource/csdk/connectivity/lib/libcoap-4.1.1/include'])
liboctbstack_env.PrependUnique(CPPPATH = [
'#resource/csdk/security/include',
'#resource/csdk/security/include/internal',
'#resource/csdk/security/provisioning/include',
+ '#resource/csdk/routing/include',
])
if 'SUB' in with_mq:
if env.get('SECURED') == '1':
liboctbstack_env.AppendUnique(LIBS = ['mbedtls','mbedx509'])
+# c_common calls into mbedcrypto.
+liboctbstack_env.AppendUnique(LIBS = ['mbedcrypto'])
+
if target_os in ['android', 'linux', 'tizen', 'msys_nt', 'windows']:
liboctbstack_env.PrependUnique(LIBS = ['connectivity_abstraction'])
else:
# On Windows, apps don't link directly with ocpmapi.lib. ocpmapi is linked
# inside octbstack.dll and apps import its APIs by linking with octbstack.lib.
- liboctbstack_env.PrependUnique(LIBS = ['ocpmapi'])
+ liboctbstack_env.PrependUnique(LIBS = ['ocpmapi_internal'])
liboctbstack_env.Textfile(target = 'octbstack_temp3.def', source = [File('octbstack_temp2.def'), File('octbstack_product_secured.def')])
if env.get('LOGGING'):
liboctbstack_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
-liboctbstack_env.Append(LIBS = ['c_common', 'mbedcrypto'])
-
if liboctbstack_env.get('ROUTING') in ['GW', 'EP']:
liboctbstack_env.Prepend(LIBS = ['routingmanager'])
if target_os not in ['linux', 'tizen', 'windows']:
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)
+internal_liboctbstack = liboctbstack_env.StaticLibrary('octbstack_internal', liboctbstack_src)
+octbstack_libs = Flatten(internal_liboctbstack)
-if target_os in ['windows', 'msys_nt']:
- # Avoid a name conflict with the octbstack.lib target of the SharedLibrary.
- static_liboctbstack = liboctbstack_env.StaticLibrary('octbstack_static', liboctbstack_src)
-else:
- static_liboctbstack = liboctbstack_env.StaticLibrary('octbstack', liboctbstack_src)
-
-octbstack_libs += Flatten(static_liboctbstack)
-
-if target_os not in ['arduino','darwin','ios'] :
+if target_os not in ['arduino', 'darwin', 'ios'] :
shared_liboctbstack = liboctbstack_env.SharedLibrary('octbstack', liboctbstack_src)
octbstack_libs += Flatten(shared_liboctbstack)
liboctbstack_env.UserInstallTargetHeader('include/ocstack.h', 'resource', 'ocstack.h')
liboctbstack_env.UserInstallTargetHeader('include/ocpresence.h', 'resource', 'ocpresence.h')
+if target_os not in ['windows', 'msys_nt']:
+ static_liboctbstack = liboctbstack_env.StaticLibrary('octbstack', liboctbstack_src)
+ octbstack_libs += Flatten(static_liboctbstack)
+
liboctbstack_env.InstallTarget(octbstack_libs, 'octbstack')
liboctbstack_env.UserInstallTargetLib(octbstack_libs, 'octbstack')