From: Ossama Othman Date: Thu, 12 Mar 2015 21:54:43 +0000 (-0700) Subject: Do not bother with C++11 check on C SDK-only platforms. X-Git-Tag: 1.2.0+RC1~1897 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fae865412d5a3c3b5e8d1d344e4e56701f289ddd;p=platform%2Fupstream%2Fiotivity.git Do not bother with C++11 check on C SDK-only platforms. 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 Reviewed-on: https://gerrit.iotivity.org/gerrit/469 Tested-by: jenkins-iotivity Reviewed-by: Jon A. Cruz Reviewed-by: Erich Keane Reviewed-by: Patrick Lankswert --- diff --git a/SConstruct b/SConstruct index aeaaf8e..ee3c0f9 100644 --- a/SConstruct +++ b/SConstruct @@ -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 diff --git a/build_common/SConscript b/build_common/SConscript index e897cfc..46cf809 100644 --- a/build_common/SConscript +++ b/build_common/SConscript @@ -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) diff --git a/resource/SConscript b/resource/SConscript index ead728e..8472f5d 100644 --- a/resource/SConscript +++ b/resource/SConscript @@ -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') diff --git a/service/SConscript b/service/SConscript index 1ea7f78..cfd6f83 100644 --- a/service/SConscript +++ b/service/SConscript @@ -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')