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')
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
# 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 *
'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)
##
Import('env')
+Import('targets_csdk_only')
target_os = env.get('TARGET_OS')
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')
#
##
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')