# Map of os and allowed archs (os: allowed archs)
os_arch_map = {
'linux': ['x86', 'x86_64', 'arm', 'arm64'],
- 'tizen': ['x86', 'x86_64', 'arm', 'arm64'],
+ 'tizen': ['x86', 'x86_64', 'arm', 'arm64', 'armeabi-v7a'],
'android': ['x86', 'x86_64', 'armeabi', 'armeabi-v7a', 'armeabi-v7a-hard', 'arm64-v8a'],
'windows': ['x86', 'amd64', 'arm'],
'winrt': ['arm'],
target_arch = ARGUMENTS.get('TARGET_ARCH', default_arch) # target arch
+# True if binary needs to be installed on board. (Might need root permissions)
+# set to 'no', 'false' or 0 for only compilation
+require_upload = ARGUMENTS.get('UPLOAD', False)
+
+if ARGUMENTS.get('TEST'):
+ logging_default = False
+else:
+ logging_default = (ARGUMENTS.get('RELEASE', True) == 'false')
+
+
+
######################################################################
# Common build options (release, target os, target arch)
######################################################################
+targets_disallow_multitransport = ['arduino']
+
help_vars = Variables()
+help_vars.Add(BoolVariable('VERBOSE', 'Show compilation', False))
help_vars.Add(BoolVariable('RELEASE', 'Build for release?', True)) # set to 'no', 'false' or 0 for debug
help_vars.Add(EnumVariable('TARGET_OS', 'Target platform', host, host_target_map[host]))
-help_vars.Add(EnumVariable('TARGET_ARCH', 'Target architecture', default_arch, os_arch_map[target_os]))
+if target_os in targets_disallow_multitransport:
+ help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ETHERNET', ['WIFI', 'BT', 'BLE', 'ETHERNET']))
+else:
+ help_vars.Add(ListVariable('TARGET_TRANSPORT', 'Target transport', 'ALL', ['ALL', 'WIFI', 'BT', 'BLE', 'ETHERNET']))
+
+help_vars.Add(EnumVariable('TARGET_ARCH', 'Target architecture', default_arch, os_arch_map[target_os]))
+help_vars.Add(EnumVariable('SECURED', 'Build with DTLS', '0', allowed_values=('0', '1')))
+help_vars.Add(EnumVariable('TEST', 'Run unit tests', '0', allowed_values=('0', '1')))
+help_vars.Add(BoolVariable('LOGGING', 'Enable stack logging', logging_default))
+help_vars.Add(BoolVariable('UPLOAD', 'Upload binary ? (For Arduino)', require_upload))
+help_vars.Add(EnumVariable('BUILD_SAMPLE', 'Build with sample', 'ON', allowed_values=('ON', 'OFF')))
######################################################################
# Platform(build target) specific options: SDK/NDK & toolchain
######################################################################
-targets_support_cc = ['linux', 'arduino']
+targets_support_cc = ['linux', 'arduino', 'tizen']
if target_os in targets_support_cc:
# Set cross compile toolchain
* cause inexplicable errors. *
*******************************************************************************
'''
+if env.get('VERBOSE') == False:
+ env['CCCOMSTR'] = "Compiling $TARGET"
+ env['CXXCOMSTR'] = "Compiling $TARGET"
+ env['LINKCOMSTR'] = "Linking $TARGET"
+ env['ARCOMSTR'] = "Archiving $TARGET"
+ env['RANLIBCOMSTR'] = "Indexing Archive $TARGET"
if target_os in targets_support_cc:
prefix = env.get('TC_PREFIX')
env.AddMethod(__append_target, 'AppendTarget')
env.AddMethod(__install, 'InstallTarget')
env.SetDir(env.GetLaunchDir())
+env['ROOT_DIR']=env.GetLaunchDir()+'/..'
Export('env')
else:
env.SConscript(target_os + '/SConscript')
+env.SConscript('external_libs.scons')
+
# Delete the temp files of configuration
if env.GetOption('clean'):
dir = env.get('SRC_DIR')