From fae865412d5a3c3b5e8d1d344e4e56701f289ddd Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Thu, 12 Mar 2015 14:54:43 -0700 Subject: [PATCH] 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 --- SConstruct | 11 ++++++++--- build_common/SConscript | 8 ++++++-- resource/SConscript | 3 ++- service/SConscript | 3 ++- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/SConstruct b/SConstruct index aeaaf8e17..ee3c0f998 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 e897cfcd1..46cf8093e 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 ead728ec4..8472f5d89 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 1ea7f7826..cfd6f83dd 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') -- 2.34.1