service/scene-manager: SConscript cleanup
authorPawel Winogrodzki <pawelwi@microsoft.com>
Thu, 22 Jun 2017 21:43:00 +0000 (14:43 -0700)
committerPhil Coval <philippe.coval@osg.samsung.com>
Thu, 29 Jun 2017 22:20:46 +0000 (22:20 +0000)
This is a scons scripts cleanup left after fixing /W4 warnings for Windows.

Preparing SConscript files for removal of arbitrary global "env"
modifications in script files outside build_common/ directory.

Bug: https://jira.iotivity.org/browse/IOT-1583
Change-Id: Ifc31a5a429f336b4fa17243e65eb5212d6253968
Signed-off-by: Pawel Winogrodzki <pawelwi@microsoft.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21151
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Tested-by: Phil Coval <philippe.coval@osg.samsung.com>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
Reviewed-by: Phil Coval <philippe.coval@osg.samsung.com>
service/scene-manager/SConscript
service/scene-manager/sampleapp/linux/SConscript

index cbd0f6e..ecdb4e4 100644 (file)
 
 Import('env')
 
-if env.get('RELEASE'):
-    env.AppendUnique(CCFLAGS=['-Os'])
-    env.AppendUnique(CPPDEFINES=['NDEBUG'])
-else:
-    env.AppendUnique(CCFLAGS=['-g'])
-
-if env.get('LOGGING'):
-    env.AppendUnique(CPPDEFINES=['TB_LOG'])
-
 lib_env = env.Clone()
 SConscript('#service/third_party_libs.scons', 'lib_env')
 scenemanager_env = lib_env.Clone()
 
 target_os = env.get('TARGET_OS')
+
+if scenemanager_env.get('RELEASE'):
+    scenemanager_env.AppendUnique(CCFLAGS=['-Os'])
+else:
+    scenemanager_env.AppendUnique(CCFLAGS=['-g'])
 ######################################################################
 # Build flags
 ######################################################################
@@ -48,6 +44,9 @@ scenemanager_env.AppendUnique(CPPPATH=[
     '../resource-encapsulation/include',
     '../resource-encapsulation/src/common/primitiveResource/include',
     '../resource-encapsulation/src/common/expiryTimer/include',
+    '#/resource/c_common',
+    '#/resource/c_common/oic_malloc/include',
+    '#/resource/c_common/oic_string/include',
     '#/resource/csdk/include',
     '#/resource/csdk/stack/include',
     '#/resource/include',
index d0f41b4..6394533 100644 (file)
@@ -8,6 +8,7 @@ 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')
+target_os = lib_env.get('TARGET_OS')
 
 ######################################################################
 # Build flags
@@ -17,6 +18,9 @@ scenemanager_sample_env.AppendUnique(CPPPATH=[
     '../../src',
     '#/service/resource-encapsulation/include',
     '#/extlibs/cjson',
+    '#/resource/c_common',
+    '#/resource/c_common/oic_malloc/include',
+    '#/resource/c_common/oic_string/include',
     '#/resource/csdk/connectivity/api',
     '#/resource/csdk/include',
     '#/resource/csdk/stack/include',
@@ -42,12 +46,13 @@ if env.get('SECURED') == '1':
     scenemanager_sample_env.AppendUnique(
         LIBS=['mbedtls', 'mbedx509', 'mbedcrypto'])
 
-if 'rt' in scenemanager_sample_env.get('LIBS'):
-    scenemanager_sample_env.Append(LIBS=['rt'])
-
 if not env.get('RELEASE'):
     scenemanager_sample_env.PrependUnique(LIBS=['gcov'])
     scenemanager_sample_env.AppendUnique(CXXFLAGS=['--coverage'])
+
+if 'gcc' == lib_env.get('CC') and target_os not in ['android']:
+    scenemanager_sample_env.AppendUnique(CFLAGS=['-pthread'])
+    scenemanager_sample_env.AppendUnique(LIBS=['pthread'])
 ####################################################################
 # Source files and Targets
 ######################################################################