Commit 71813edf authored by Habib Virji's avatar Habib Virji

[IOT-1462] Generate shared library for resource directory

Generate shared library for all platforms. Require update to all example
and unittest as test uses shared library.

https://jira.iotivity.org/browse/IOT-1462

Change-Id: I9d169d8e4e08835f3e57f1771789fe5b90636da7
Signed-off-by: default avatarHabib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13657Tested-by: default avatarjenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: default avatarJaehong Jo <jaehong.jo@samsung.com>
parent b9885b46
......@@ -35,15 +35,16 @@ rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
######################################################################
rd_env.AppendUnique(CPPPATH = ['include', 'src/internal', '../stack/include', '../../oc_logger/include'])
rd_env.AppendUnique(CPPPATH = ['include', 'src/internal', '../stack/include'])
if 'CLIENT' in rd_mode:
rd_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
if 'SERVER' in rd_mode:
rd_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
rd_env.AppendUnique(LIBPATH = [rd_env.get('BUILD_DIR')])
rd_env.AppendUnique(LIBS = ['octbstack'])
rd_env.PrependUnique(LIBPATH = [rd_env.get('BUILD_DIR')])
rd_env.PrependUnique(RPATH = [rd_env.get('BUILD_DIR')])
rd_env.PrependUnique(LIBS = ['octbstack'])
if target_os not in ['windows']:
rd_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra'])
......@@ -76,8 +77,10 @@ if 'SERVER' in rd_mode:
if 'CLIENT' in rd_mode:
rd_src += [RD_SRC_DIR + 'rd_client.c',]
if target_os in ['tizen']:
rdsdk = rd_env.SharedLibrary('resource_directory', rd_src)
if target_os not in ['arduino', 'darwin', 'ios', 'windows', 'winrt']:
rdsdk_shared = rd_env.SharedLibrary('resource_directory', rd_src)
rdsdk_static = rd_env.StaticLibrary('resource_directory', rd_src)
rdsdk = Flatten([rdsdk_static, rdsdk_shared])
else :
rdsdk = rd_env.StaticLibrary('resource_directory', rd_src)
rd_env.InstallTarget(rdsdk, 'resource_directory')
......
......@@ -28,6 +28,7 @@ src_dir = provisiontests_env.get('SRC_DIR')
target_os = provisiontests_env.get('TARGET_OS')
with_ra = provisiontests_env.get('WITH_RA')
with_ra_ibb = provisiontests_env.get('WITH_RA_IBB')
rd_mode = provisiontests_env.get('RD_MODE')
######################################################################
# Build flags
......@@ -81,6 +82,9 @@ if provisiontests_env.get('SECURED') == '1':
if provisiontests_env.get('LOGGING'):
provisiontests_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
provisiontests_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Source files and Targets
######################################################################
......
......@@ -34,6 +34,8 @@ if env.get('LOGGING'):
env.AppendUnique(CPPDEFINES = ['TB_LOG'])
lib_env = env.Clone()
rd_mode = env.get('RD_MODE')
SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
######################################################################
......@@ -74,6 +76,12 @@ if easysetup_test_env.get('SECURED') == '1':
if easysetup_test_env.get('WITH_TCP') == True:
easysetup_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
if 'CLIENT' in rd_mode:
easysetup_test_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
if 'SERVER' in rd_mode:
easysetup_test_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
easysetup_test_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......
......@@ -44,6 +44,7 @@ gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
easysetup_test_env = lib_env.Clone()
target_os = env.get('TARGET_OS')
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
......@@ -74,6 +75,13 @@ if env.get('SECURED') == '1':
if env.get('WITH_TCP') == True:
easysetup_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
if 'CLIENT' in rd_mode:
easysetup_test_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
if 'SERVER' in rd_mode:
easysetup_test_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
easysetup_test_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......@@ -90,4 +98,3 @@ if env.get('TEST') == '1':
if target_os == 'linux':
from tools.scons.RunTest import *
run_test(easysetup_mediator_test_env, '', 'service/easy-setup/mediator/richsdk/unittests/easysetup_mediator_test')
......@@ -28,6 +28,7 @@ print Dir('.').abspath
enrollee_env = env.Clone()
transport = enrollee_env.get('TARGET_TRANSPORT')
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
......@@ -61,6 +62,9 @@ if enrollee_env.get('SECURED') == '1':
if enrollee_env.get('WITH_TCP') == True:
enrollee_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
enrollee_env.AppendUnique(LIBS = ['resource_directory'])
enrollee = enrollee_env.Program('enrollee', ['enrolleewifi.c', 'easysetup_x.c'])
i_enrollee = enrollee_env.Install(env.get('BUILD_DIR'), enrollee)
......
......@@ -23,6 +23,7 @@ Import('env')
mediator_env = env.Clone()
target_os = env.get('TARGET_OS')
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
......@@ -43,6 +44,9 @@ env.AppendUnique(CPPDEFINES = ['CPP_MEDIATOR'])
if target_os not in ['windows']:
mediator_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
mediator_env.AppendUnique(LIBS = ['resource_directory'])
mediator_env.PrependUnique(CPPPATH = [
env.get('SRC_DIR') + '/resource/include',
env.get('SRC_DIR') + '/resource/oc_logger/include',
......
......@@ -28,6 +28,7 @@ lib_env = env.Clone()
SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
notification_sample_env = lib_env.Clone()
rd_mode = env.get('RD_MODE')
target_os = env.get('TARGET_OS')
######################################################################
# Build flags
......@@ -74,6 +75,13 @@ if env.get('WITH_TCP') == True:
if env.get('SECURED') == '1':
notification_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
if 'CLIENT' in rd_mode:
notification_sample_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
if 'SERVER' in rd_mode:
notification_sample_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
notification_sample_env.AppendUnique(LIBS = ['resource_directory'])
####################################################################
# Source files and Targets
######################################################################
......
......@@ -21,6 +21,7 @@
#include <iostream>
#include <stdlib.h>
#include <cstdint>
#include <limits>
#include "NSCommon.h"
#include "NSProviderService.h"
#include "NSUtils.h"
......
......@@ -34,6 +34,7 @@ if env.get('LOGGING'):
env.AppendUnique(CPPDEFINES = ['TB_LOG'])
lib_env = env.Clone()
rd_mode = env.get('RD_MODE')
SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
######################################################################
......@@ -53,7 +54,7 @@ GTest_Main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
notification_wrapper_test_env.AppendUnique(LIBPATH = [lib_env.get('BUILD_DIR')])
notification_wrapper_test_env.AppendUnique(LIBS = [
'connectivity_abstraction', 'oc', 'octbstack', 'oc_logger', 'coap',
'connectivity_abstraction', 'oc', 'octbstack', 'oc_logger', 'coap',
GTest_Main, GTest])
if env.get('WITH_TCP') == True:
......@@ -61,6 +62,13 @@ if env.get('WITH_TCP') == True:
if env.get('SECURED') == '1':
notification_wrapper_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
if 'CLIENT' in rd_mode:
notification_wrapper_test_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
if 'SERVER' in rd_mode:
notification_wrapper_test_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
notification_wrapper_test_env.AppendUnique(LIBS = ['resource_directory'])
if target_os not in ['windows', 'winrt']:
notification_wrapper_test_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
......@@ -101,4 +109,4 @@ if env.get('TEST') == '1':
if target_os == 'linux':
from tools.scons.RunTest import *
run_test(notification_consumer_wrapper_test_env, '', 'service/notification/cpp-wrapper/unittest/notification_consumer_wrapper_test')
run_test(notification_provider_wrapper_test_env, '', 'service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test')
\ No newline at end of file
run_test(notification_provider_wrapper_test_env, '', 'service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test')
......@@ -9,6 +9,7 @@ SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
notification_sample_env = lib_env.Clone()
target_os = env.get('TARGET_OS')
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
######################################################################
......@@ -65,6 +66,9 @@ if env.get('WITH_TCP') == True:
if env.get('SECURED') == '1':
notification_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
notification_sample_env.AppendUnique(LIBS = ['resource_directory'])
####################################################################
# Source files and Targets
######################################################################
......
......@@ -34,6 +34,7 @@ if env.get('LOGGING'):
env.AppendUnique(CPPDEFINES = ['TB_LOG'])
lib_env = env.Clone()
rd_mode = env.get('RD_MODE')
SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
######################################################################
......@@ -72,6 +73,13 @@ if env.get('WITH_TCP') == True:
if env.get('SECURED') == '1':
notification_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
if 'CLIENT' in rd_mode:
notification_test_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
if 'SERVER' in rd_mode:
notification_test_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
notification_test_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......
......@@ -41,6 +41,8 @@ SConscript('#service/third_party_libs.scons', exports = 'lib_env')
resource_container_env = lib_env.Clone()
target_os = env.get('TARGET_OS')
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
######################################################################
......@@ -237,6 +239,9 @@ Ignore("examples/ResourceContainerConfig.xml", "examples/ResourceContainerConfig
containersample_env.AppendUnique(LIBS = ['rcs_container'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
containersample_env.AppendUnique(LIBS = ['resource_directory'])
containersampleapp_src = ['examples/ContainerSample.cpp']
containersampleapp = containersample_env.Program('ContainerSample',containersampleapp_src)
Alias("containersample", containersampleapp)
......
......@@ -8,6 +8,7 @@ Import('env')
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
linux_sample_env = lib_env.Clone()
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
......@@ -31,6 +32,9 @@ if env.get('SECURED') == '1':
if 'rt' in linux_sample_env.get('LIBS'):
linux_sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
linux_sample_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
#build sampleapp
######################################################################
......
......@@ -8,6 +8,7 @@ Import('env')
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
linux_sample_env = lib_env.Clone()
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
......@@ -31,6 +32,9 @@ if env.get('SECURED') == '1':
if 'rt' in linux_sample_env.get('LIBS'):
linux_sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
linux_sample_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
#build sampleapp
######################################################################
......
......@@ -8,6 +8,7 @@ Import('env')
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
linux_sample_env = lib_env.Clone()
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
......@@ -31,6 +32,9 @@ if env.get('SECURED') == '1':
if 'rt' in linux_sample_env.get('LIBS'):
linux_sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
linux_sample_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
#build sampleapp
######################################################################
......
......@@ -8,6 +8,7 @@ Import('env')
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
linux_sample_env = lib_env.Clone()
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
......@@ -31,6 +32,9 @@ if env.get('SECURED') == '1':
if 'rt' in linux_sample_env.get('LIBS'):
linux_sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
linux_sample_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
#build sampleapp
######################################################################
......
......@@ -29,6 +29,7 @@ gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
target_os = lib_env.get('TARGET_OS')
src_dir = lib_env.get('SRC_DIR')
rd_mode = lib_env.get('RD_MODE')
containerJavaSupport = ARGUMENTS.get('containerJavaSupport',0)
......@@ -138,6 +139,9 @@ if container_gtest_env.get('SECURED') == '1':
if container_gtest_env.get('WITH_TCP') == True:
container_gtest_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
container_gtest_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# build test bundle
######################################################################
......
......@@ -28,6 +28,7 @@ lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
sample_env = lib_env.Clone()
rd_mode = lib_env.get('RD_MODE')
sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
sample_env.AppendUnique(LIBS = [
......@@ -47,6 +48,9 @@ if env.get('SECURED') == '1':
if 'rt' in sample_env.get('LIBS'):
sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
sample_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# ##### Client #####
######################################################################
......
......@@ -26,8 +26,8 @@ Import('env')
# Add third party libraries
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
sample_env = lib_env.Clone()
rd_mode = env.get('RD_MODE')
sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
sample_env.AppendUnique(LIBS = [
......@@ -49,6 +49,9 @@ if env.get('SECURED') == '1':
if 'rt' in sample_env.get('LIBS'):
sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
sample_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# ##### Authorized Client #####
######################################################################
......
......@@ -33,6 +33,7 @@ rcs_common_env = lib_env.Clone()
target_os = rcs_common_env.get('TARGET_OS')
release = rcs_common_env.get('RELEASE')
src_dir = rcs_common_env.get('SRC_DIR')
rd_mode = rcs_common_env.get('RD_MODE')
######################################################################
# Build flags
......@@ -68,6 +69,10 @@ if not release:
if rcs_common_env.get('SECURED') == '1':
if rcs_common_env.get('WITH_TCP') == True:
rcs_common_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
rcs_common_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Source files and Targets
######################################################################
......
......@@ -24,6 +24,7 @@
# SConscript file for Local PKI google tests
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
rd_mode = lib_env.get('RD_MODE')
if lib_env.get('RELEASE'):
lib_env.AppendUnique(CCFLAGS = ['-Os'])
......@@ -73,6 +74,9 @@ if broker_test_env.get('SECURED') == '1':
if broker_test_env.get('WITH_TCP') == True:
broker_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
broker_test_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......
......@@ -24,6 +24,7 @@
# SConscript file for Local PKI google tests
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
rd_mode = lib_env.get('RD_MODE')
if lib_env.get('RELEASE'):
lib_env.AppendUnique(CCFLAGS = ['-Os'])
......@@ -66,6 +67,9 @@ if cache_test_env.get('SECURED') == '1':
if cache_test_env.get('WITH_TCP') == True:
cache_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
cache_test_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......
......@@ -24,6 +24,7 @@
# SConscript file for Local PKI google tests
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
rd_mode = lib_env.get('RD_MODE')
# Add third party libraries
SConscript('#service/third_party_libs.scons', exports = 'lib_env')
......@@ -67,6 +68,10 @@ if target_os in ['android']:
if server_builder_env.get('SECURED') == '1':
if server_builder_env.get('WITH_TCP') == True:
server_builder_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
server_builder_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Source files and Targets
######################################################################
......
......@@ -25,6 +25,7 @@
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
target_os = lib_env.get('TARGET_OS')
rd_mode = lib_env.get('RD_MODE')
if lib_env.get('RELEASE'):
lib_env.AppendUnique(CCFLAGS = ['-Os'])
......@@ -74,6 +75,9 @@ if lib_env.get('SECURED') == '1':
if lib_env.get('WITH_TCP') == True:
rcs_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
rcs_test_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......
......@@ -7,6 +7,7 @@ Import('env')
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
resourcehosting_env = lib_env.Clone()
rd_mode = lib_env.get('RD_MODE')
######################################################################
# Build flags
......@@ -45,6 +46,10 @@ if 'rt' in resourcehosting_env.get('LIBS'):
if 'rt' in resourcehosting_sample_env.get('LIBS'):
resourcehosting_sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
resourcehosting_sample_env.AppendUnique(LIBS = ['resource_directory'])
resourcehosting_env.AppendUnique(LIBS = ['resource_directory'])
####################################################################
# Source files and Targets
######################################################################
......
......@@ -44,6 +44,7 @@ src_dir = lib_env.get('SRC_DIR')
hosting_test_env = lib_env.Clone()
target_os = hosting_test_env.get('TARGET_OS')
rd_mode = lib_env.get('RD_MODE')
######################################################################
# Build flags
......@@ -66,6 +67,10 @@ hosting_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/src/commo
if hosting_test_env.get('SECURED') == '1':
if hosting_test_env.get('WITH_TCP') == True:
hosting_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
hosting_test_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......
......@@ -7,6 +7,7 @@ Import('env')
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
scenemanager_sample_env = lib_env.Clone()
rd_mode = lib_env.get('RD_MODE')
######################################################################
# Build flags
......@@ -33,6 +34,9 @@ if env.get('SECURED') == '1':
if 'rt' in scenemanager_sample_env.get('LIBS'):
scenemanager_sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
scenemanager_sample_env.AppendUnique(LIBS = ['resource_directory'])
if not env.get('RELEASE'):
scenemanager_sample_env.PrependUnique(LIBS = ['gcov'])
scenemanager_sample_env.AppendUnique(CXXFLAGS = ['--coverage'])
......@@ -43,4 +47,3 @@ sceneserver = scenemanager_sample_env.Program('sceneserver', 'sceneserver.cpp')
sceneclient = scenemanager_sample_env.Program('sceneclient', 'sceneclient.cpp')
fanserver = scenemanager_sample_env.Program('fanserver', 'fanserver.cpp')
lightserver = scenemanager_sample_env.Program('lightserver', 'lightserver.cpp')
......@@ -24,6 +24,7 @@
# SConscript file for Local PKI google tests
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
rd_mode = lib_env.get('RD_MODE')
if lib_env.get('RELEASE'):
lib_env.AppendUnique(CCFLAGS = ['-Os'])
......@@ -43,6 +44,7 @@ src_dir = lib_env.get('SRC_DIR')
scene_test_env = lib_env.Clone()
target_os = scene_test_env.get('TARGET_OS')
rd_mode = scene_test_env.get('RD_MODE')
######################################################################
# Build flags
......@@ -70,6 +72,10 @@ scene_test_env.AppendUnique(CPPPATH = ['../../resource-encapsulation/src/common/
if scene_test_env.get('SECURED') == '1':
if scene_test_env.get('WITH_TCP') == True:
scene_test_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
scene_test_env.PrependUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......
......@@ -28,6 +28,7 @@ Import('env')
lib_env = env.Clone()
SConscript('#service/third_party_libs.scons', 'lib_env')
linux_sample_env = lib_env.Clone()
rd_mode = env.get('RD_MODE')
######################################################################
# Build flags
......@@ -56,6 +57,8 @@ if env.get('SECURED') == '1':
if 'rt' in linux_sample_env.get('LIBS'):
linux_sample_env.Append(LIBS = ['rt'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
linux_sample_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
#build sampleapp
######################################################################
......
......@@ -27,6 +27,7 @@ import os
gtest_env = SConscript('#extlibs/gtest/SConscript')
lib_env = gtest_env.Clone()
target_os = lib_env.get('TARGET_OS')
rd_mode = lib_env.get('RD_MODE')
if lib_env.get('RELEASE'):
lib_env.AppendUnique(CCFLAGS = ['-Os'])
......@@ -74,6 +75,10 @@ ThingsManager_gtest_env.PrependUnique(LIBS = [
if ThingsManager_gtest_env.get('SECURED') == '1':
if ThingsManager_gtest_env.get('WITH_TCP') == True:
ThingsManager_gtest_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
if 'CLIENT' in rd_mode or 'SERVER' in rd_mode:
ThingsManager_gtest_env.AppendUnique(LIBS = ['resource_directory'])
######################################################################
# Build Test
######################################################################
......