resource: Removing redundant env configuration 47/21947/6
authorPawel Winogrodzki <pawelwi@microsoft.com>
Tue, 15 Aug 2017 21:52:16 +0000 (14:52 -0700)
committerPhil Coval <philippe.coval@osg.samsung.com>
Fri, 25 Aug 2017 08:02:07 +0000 (08:02 +0000)
Moving global environment configuration common for all
platforms into build_common/SConscript and removing repeated
lines from resource/*.

Bug: https://jira.iotivity.org/browse/IOT-1583
Change-Id: I8383c7d2f14b1c9fea286e0836db50b45b45acb2
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21947
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: George Nash <george.nash@intel.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
resource/IPCA/unittests/SConscript
resource/provisioning/unittests/SConscript
resource/unittests/SConscript

index 351cce6..0a4703e 100644 (file)
@@ -32,30 +32,37 @@ target_os = ipcatest_env.get('TARGET_OS')
 ######################################################################
 # Build flags
 ######################################################################
-ipcatest_env.AppendUnique(CPPPATH = [
-        '#/resource/include',
-        '#/resource/oc_logger/include',
-        '#/resource/csdk/include',
-        '#/resource/csdk/stack/include',
-        '#/resource/csdk/security/include',
-        '#/resource/csdk/security/provisioning/include',
-        '#/resource/csdk/security/provisioning/include/internal',
-        '#/resource/csdk/stack/include/internal',
-        '#/resource/csdk/connectivity/api',
-        '#/resource/csdk/connectivity/external/inc',
-        '#/resource/csdk/ocsocket/include',
-        '#/resource/csdk/logger/include',
-        '#/resource/c_common/ocrandom/include',
-        '#/extlibs/boost/boost',
-        '#/extlibs/libcoap/libcoap/include',
-        '../inc',
-        '../src/inc'
-        ])
-
-ipcatest_env.PrependUnique(LIBS = [
+ipcatest_env.AppendUnique(CPPPATH=[
+    '#/resource/include',
+    '#/resource/oc_logger/include',
+    '#/resource/csdk/include',
+    '#/resource/csdk/stack/include',
+    '#/resource/csdk/security/include',
+    '#/resource/csdk/security/provisioning/include',
+    '#/resource/csdk/security/provisioning/include/internal',
+    '#/resource/csdk/stack/include/internal',
+    '#/resource/csdk/connectivity/api',
+    '#/resource/csdk/connectivity/external/inc',
+    '#/resource/csdk/ocsocket/include',
+    '#/resource/csdk/logger/include',
+    '#/resource/c_common',
+    '#/resource/c_common/ocrandom/include',
+    '#/resource/c_common/octhread/include',
+    '#/resource/c_common/oic_malloc/include',
+    '#/resource/c_common/oic_string/include',
+    '#/resource/c_common/oic_time/include',
+    '#/extlibs/boost/boost',
+    '#/extlibs/libcoap/libcoap/include',
+    '../inc',
+    '../src/inc',
+])
+
+ipcatest_env.PrependUnique(LIBS=[
         'oc_logger_internal',
         'octbstack',
-        'ipca_static'
+        'ipca_static',
+        'logger',
+        'c_common',
         ])
 
 if use_iotivity == 1:
@@ -75,6 +82,7 @@ if use_iotivity == 1:
 
 if target_os in ['msys_nt', 'windows']:
     ipcatest_env.AppendUnique(LINKFLAGS = ['/subsystem:CONSOLE'])
+    ipcatest_env.AppendUnique(LIBS=['win_helper'])
 
 ######################################################################
 # Source files and Targets
index 948a6dc..37098b8 100644 (file)
@@ -35,32 +35,34 @@ with_ra_ibb = provisiontests_env.get('WITH_RA_IBB')
 # Build flags
 ######################################################################
 provisiontests_env.PrependUnique(CPPPATH = [
-        '../../include',
-        '../../oc_logger/include',
-        '../../csdk/include',
-        '../../csdk/stack/include',
-        '../../csdk/security/include',
-        '../../csdk/security/provisioning/include',
-        '../../csdk/security/provisioning/include/oxm',
-        '../../csdk/security/provisioning/include/internal',
-        '../../csdk/security/provisioning/include/cloud',
-        '../../csdk/stack/include/internal',
-        '../../csdk/connectivity/api',
-        '../../csdk/connectivity/inc/pkix',
-        '../../csdk/connectivity/external/inc',
-        '../../csdk/ocsocket/include',
-        '../../csdk/ocrandom/include',
-        '../../csdk/logger/include',
-        '../../csdk/connectivity/lib/libcoap-4.1.1/include',
-        '../../../extlibs/hippomocks/hippomocks/',
-        '../../../extlibs/hippomocks/hippomocks/'
+        '#/resource/include',
+        '#/resource/c_common',
+        '#/resource/c_common/oic_malloc/include',
+        '#/resource/c_common/oic_string/include',
+        '#/resource/oc_logger/include',
+        '#/resource/csdk/include',
+        '#/resource/csdk/stack/include',
+        '#/resource/csdk/security/include',
+        '#/resource/csdk/security/provisioning/include',
+        '#/resource/csdk/security/provisioning/include/oxm',
+        '#/resource/csdk/security/provisioning/include/internal',
+        '#/resource/csdk/security/provisioning/include/cloud',
+        '#/resource/csdk/stack/include/internal',
+        '#/resource/csdk/connectivity/api',
+        '#/resource/csdk/connectivity/inc/pkix',
+        '#/resource/csdk/connectivity/external/inc',
+        '#/resource/csdk/ocsocket/include',
+        '#/resource/csdk/ocrandom/include',
+        '#/resource/csdk/logger/include',
+        '#/resource/csdk/connectivity/lib/libcoap-4.1.1/include',
+        '#/extlibs/hippomocks/hippomocks',
         ])
 
 if target_os in ['windows']:
     # Non-Windows platforms find the boost headers under /usr/include or similar path.
     provisiontests_env.AppendUnique(CPPPATH = ['#extlibs/boost/boost'])
 
-    provisiontests_env.AppendUnique(LIBS = ['sqlite3'])
+    provisiontests_env.AppendUnique(LIBS=['sqlite3', 'win_helper'])
 elif target_os in ['tizen', 'linux']:
     provisiontests_env.ParseConfig('pkg-config --cflags --libs sqlite3 gobject-2.0 gio-2.0 glib-2.0')
 
@@ -71,9 +73,12 @@ provisiontests_env.PrependUnique(LIBS = [
         'octbstack_internal',
         'routingmanager',
         'oc_logger_internal',
+        'logger',
         'connectivity_abstraction_internal',
         'coap',
-        'ocsrm'
+        'ocsrm',
+        'routingmanager',
+        'c_common',
         ])
 
 if with_ra_ibb:
@@ -88,9 +93,6 @@ else :
 if provisiontests_env.get('SECURED') == '1':
     provisiontests_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
 
-if provisiontests_env.get('LOGGING'):
-    provisiontests_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
-
 ######################################################################
 # Source files and Targets
 ######################################################################
index a56c19a..9861d6e 100644 (file)
@@ -34,24 +34,29 @@ with_mq = unittests_env.get('WITH_MQ')
 # Build flags
 ######################################################################
 unittests_env.PrependUnique(CPPPATH = [
-        '../include',
-        '../oc_logger/include',
-        '../csdk/include',
-        '../csdk/stack/include',
-        '../csdk/security/include',
-        '../csdk/stack/include/internal',
-        '../csdk/connectivity/api',
-        '../csdk/connectivity/external/inc',
-        '../csdk/ocsocket/include',
-        '../c_common/ocrandom/include',
-        '../csdk/logger/include',
-        '#extlibs/hippomocks/hippomocks',
+        '#/resource/include',
+        '#/resource/oc_logger/include',
+        '#/resource/csdk/include',
+        '#/resource/csdk/stack/include',
+        '#/resource/csdk/security/include',
+        '#/resource/csdk/stack/include/internal',
+        '#/resource/csdk/connectivity/api',
+        '#/resource/csdk/connectivity/external/inc',
+        '#/resource/csdk/ocsocket/include',
+        '#/resource/c_common',
+        '#/resource/c_common/ocrandom/include',
+        '#/resource/c_common/octhread/include',
+        '#/resource/c_common/oic_malloc/include',
+        '#/resource/c_common/oic_string/include',
+        '#/resource/c_common/oic_time/include',
+        '#/resource/csdk/logger/include',
+        '#/extlibs/hippomocks/hippomocks',
         ])
 
 if target_os in ['windows']:
     # Non-Windows platforms find the boost headers under /usr/include or similar path.
     unittests_env.AppendUnique(CPPPATH = ['#extlibs/boost/boost'])
-    unittests_env.AppendUnique(LIBS = ['sqlite3'])
+    unittests_env.AppendUnique(LIBS=['sqlite3', 'win_helper'])
 
     if unittests_env['CC'] == 'cl':
         # Fix for: resource\unittests\OCRepresentationEncodingTest.cpp "fatal error C1128:
@@ -60,15 +65,20 @@ if target_os in ['windows']:
 elif target_os in ['linux', 'tizen']:
     unittests_env.ParseConfig('pkg-config --cflags --libs sqlite3 gobject-2.0 gio-2.0 glib-2.0')
 
-unittests_env.PrependUnique(LIBS = [
-        'oc',
-        'octbstack_internal',
-        'ocsrm',
-        'routingmanager',
-        'oc_logger_internal',
-        'connectivity_abstraction_internal',
-        'coap',
-        ])
+unittests_env.PrependUnique(LIBS=[
+    'oc',
+    'octbstack_internal',
+    'ocsrm',
+    'routingmanager',
+    'oc_logger_internal',
+    'logger',
+    'connectivity_abstraction_internal',
+    'coap',
+    'c_common',
+])
+
+if target_os in ['linux', 'tizen']:
+    unittests_env.AppendUnique(LIBS = ['rt'])
 
 if unittests_env.get('SECURED') == '1':
     unittests_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509'])
@@ -76,12 +86,6 @@ if unittests_env.get('SECURED') == '1':
 # c_common calls into mbedcrypto.
 unittests_env.AppendUnique(LIBS = ['mbedcrypto'])
 
-if unittests_env.get('LOGGING'):
-    unittests_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
-
-if unittests_env.get('WITH_CLOUD'):
-    unittests_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
-
 ######################################################################
 # Source files and Targets
 ######################################################################