Do not bother with C++11 check on C SDK-only platforms.
authorOssama Othman <ossama.othman@intel.com>
Thu, 12 Mar 2015 21:54:43 +0000 (14:54 -0700)
committerPatrick Lankswert <patrick.lankswert@intel.com>
Fri, 13 Mar 2015 14:21:41 +0000 (14:21 +0000)
Some IoTivity platforms, such as Arduino, only require the C SDK.  Do
not bother running the C++11 flag check for those platforms.  This
also addresses a problem where Arduino 1.0.x builds would erroneously
fail due to lack of C++11 support.

Change-Id: I1782a258837850adb65e7219254fdeee259a3cc7
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/469
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
Reviewed-by: Patrick Lankswert <patrick.lankswert@intel.com>
SConstruct
build_common/SConscript
resource/SConscript
service/SConscript

index aeaaf8e..ee3c0f9 100644 (file)
@@ -5,8 +5,11 @@
 
 import os
 
+# List of targets that only support the IoTivity C SDK.
+targets_csdk_only = ['arduino']
+
 # Load common build config
-SConscript('build_common/SConscript')
+SConscript('build_common/SConscript', exports = 'targets_csdk_only')
 
 Import('env')
 
@@ -32,10 +35,12 @@ else:
 build_dir = env.get('BUILD_DIR')
 
 # Build 'resource' sub-project
-SConscript(os.path.join(build_dir, 'resource', 'SConscript'))
+SConscript(os.path.join(build_dir, 'resource', 'SConscript'),
+           exports = 'targets_csdk_only')
 
 # Build 'service' sub-project
-SConscript(os.path.join(build_dir, 'service', 'SConscript'))
+SConscript(os.path.join(build_dir, 'service', 'SConscript'),
+           exports = 'targets_csdk_only')
 
 # Append targets information to the help information, to see help info, execute command line:
 #     $ scon [options] -h
index e897cfc..46cf809 100644 (file)
@@ -238,6 +238,7 @@ else:
 # make sure we give the automated build configuration below an
 # opportunity to detect platform-specific anomalies.
 # -------------------------------------------------------------------
+Import('targets_csdk_only')
 import iotivityconfig
 from iotivityconfig import *
 
@@ -246,8 +247,11 @@ conf = env.Configure(
                 'CheckCXX11Flags' : iotivityconfig.check_cxx11_flags
         } )
 
-# IoTivity requires support for C++11.
-if not conf.CheckCXX11Flags():
+# IoTivity requires support for C++11 for the C++ SDK.
+#
+# However, some platforms, such as Arduino, only support the C SDK.
+# Don't bother running the C++11 check in those cases.
+if target_os not in targets_csdk_only and not conf.CheckCXX11Flags():
         print('C++11 support is required!')
         Exit(1)
 
index ead728e..8472f5d 100644 (file)
@@ -4,6 +4,7 @@
 ##
 
 Import('env')
+Import('targets_csdk_only')
 
 target_os = env.get('TARGET_OS')
 
@@ -16,7 +17,7 @@ SConscript('csdk/SConscript')
 if target_os == 'android':
        SConscript('android/SConscript')
 
-if target_os != 'arduino':
+if target_os not in targets_csdk_only:
        # Build liboc_logger
        SConscript('oc_logger/SConscript')
 
index 1ea7f78..cfd6f83 100644 (file)
@@ -3,10 +3,11 @@
 #
 ##
 Import('env')
+Import('targets_csdk_only')
 
 target_os = env.get('TARGET_OS')
 
-if target_os != 'arduino':
+if target_os not in targets_csdk_only:
        # Build things manager project
        SConscript('things-manager/SConscript')