[IOT-1462] Generate shared library for resource directory
authorHabib Virji <habib.virji@samsung.com>
Tue, 25 Oct 2016 14:06:15 +0000 (15:06 +0100)
committerHabib Virji <habib.virji@samsung.com>
Mon, 31 Oct 2016 07:58:11 +0000 (07:58 +0000)
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: Habib Virji <habib.virji@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/13657
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
30 files changed:
resource/csdk/resource-directory/SConscript
resource/provisioning/unittests/SConscript
service/easy-setup/enrollee/unittests/SConscript
service/easy-setup/mediator/richsdk/unittests/SConscript
service/easy-setup/sampleapp/enrollee/linux/SConscript
service/easy-setup/sampleapp/mediator/linux/richsdk_sample/SConscript
service/notification/cpp-wrapper/examples/linux/SConscript
service/notification/cpp-wrapper/examples/linux/notificationserviceprovider.cpp
service/notification/cpp-wrapper/unittest/SConscript
service/notification/examples/linux/SConscript
service/notification/unittest/SConscript
service/resource-container/SConscript
service/resource-container/examples/BMISensorBundle/src/inputSensors/HeightSensorApp/SConscript
service/resource-container/examples/BMISensorBundle/src/inputSensors/WeightSensorApp/SConscript
service/resource-container/examples/DiscomfortIndexSensorBundle/src/inputSensors/THSensorApp/SConscript
service/resource-container/examples/DiscomfortIndexSensorBundle/src/inputSensors/THSensorApp1/SConscript
service/resource-container/unittests/SConscript
service/resource-encapsulation/examples/linux/SConscript
service/resource-encapsulation/examples/linux/secureResourceExample/SConscript
service/resource-encapsulation/src/common/SConscript
service/resource-encapsulation/src/resourceBroker/unittest/SConscript
service/resource-encapsulation/src/resourceCache/unittests/SConscript
service/resource-encapsulation/src/serverBuilder/SConscript
service/resource-encapsulation/unittests/SConscript
service/resource-hosting/SampleApp/linux/SConscript
service/resource-hosting/unittest/SConscript
service/scene-manager/sampleapp/linux/SConscript
service/scene-manager/unittests/SConscript
service/things-manager/sampleapp/linux/configuration/SConscript
service/things-manager/unittests/SConscript

index 44413f4..9e37166 100755 (executable)
@@ -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')
index c7a4561..70f1a63 100755 (executable)
@@ -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
 ######################################################################
index cee6dd0..d64bcd8 100644 (file)
@@ -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
 ######################################################################
index 386c799..5d86303 100644 (file)
@@ -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')
-
index 8918906..c024a96 100644 (file)
@@ -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)
index 2f422a2..a226aff 100644 (file)
@@ -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',
index bff7f1c..cf509cb 100755 (executable)
@@ -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
 ######################################################################
index 05fa825..75fe44d 100755 (executable)
@@ -21,6 +21,7 @@
 #include <iostream>\r
 #include <stdlib.h>\r
 #include <cstdint>\r
+#include <limits>\r
 #include "NSCommon.h"\r
 #include "NSProviderService.h"\r
 #include "NSUtils.h"\r
index 90ef7f5..f6d20de 100644 (file)
@@ -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')
index 826e60f..de1a2ab 100644 (file)
@@ -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
 ######################################################################
index a0aae39..b717b77 100644 (file)
@@ -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
 ######################################################################
index 551d054..13cc441 100644 (file)
@@ -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)
index 7548813..f05ad5b 100644 (file)
@@ -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
 ######################################################################
index 10cd7d6..96410a7 100644 (file)
@@ -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
 ######################################################################
index 9cb35f7..5ac5a87 100644 (file)
@@ -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
 ######################################################################
index 7643066..909db59 100644 (file)
@@ -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
 ######################################################################
index 6199dd3..a528c74 100644 (file)
@@ -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
 ######################################################################
index 90fbd58..c131c13 100644 (file)
@@ -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 #####
 ######################################################################
index 0eef19a..429afec 100644 (file)
@@ -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 #####
 ######################################################################
index 72ab45e..9eac4c5 100644 (file)
@@ -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
 ######################################################################
index f6d7e36..20ec0c2 100644 (file)
@@ -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
 ######################################################################
index 80ff7c1..82bd59e 100644 (file)
@@ -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
 ######################################################################
index f7c68ef..1eb9b60 100644 (file)
@@ -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
 ######################################################################
index 9aad325..2ade999 100644 (file)
@@ -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
 ######################################################################
index 71860b5..bb37626 100644 (file)
@@ -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
 ######################################################################
index dd48996..c26720f 100644 (file)
@@ -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
 ######################################################################
index 6853e4b..d483aac 100644 (file)
@@ -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')
-
index 6f67ea7..f334218 100644 (file)
@@ -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
 ######################################################################
index 36d95c9..9a80453 100644 (file)
@@ -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
 ######################################################################
index 2ab8200..4c03f27 100644 (file)
@@ -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
 ######################################################################