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 aeaaf8e1715ce0139cdab67d4427aa898b12b389..ee3c0f998503dc8547990cbf0b2db053485cfe5e 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 e897cfcd1d4ecfe955bdafb096292e2df0145498..46cf8093e73f1ac74d0623dd683218a5602c67a0 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 ead728ec4fa4fc220c13c0cf44a5f6e69265f506..8472f5d89ed04ffa8d2f46e15aa552073a0a6de8 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 1ea7f7826a99ba5175550da8ed95df17a192f6a9..cfd6f83dde4a88e0949980c7354aaa919a3a7fd1 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')