target_os = sqlite_env.get('TARGET_OS')
src_dir = sqlite_env.get('SRC_DIR')
-targets_need_sqlite = ['android', 'msys_nt', 'windows']
+targets_need_sqlite = ['android', 'msys_nt', 'windows', 'ios']
sqlite_dir = src_dir + '/extlibs/sqlite3/'
sqlite_build_dir = src_dir + '/extlibs/sqlite3/sqlite-amalgamation-3081101/'
sqlite_zip_file = src_dir + '/extlibs/sqlite3/sqlite-amalgamation-3081101.zip'
# Build liboctbstack
SConscript('csdk/SConscript')
-if target_os not in ['arduino','darwin','ios']:
+if target_os not in ['arduino','darwin']:
# Build liboc_logger
SConscript('oc_logger/SConscript')
env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
if with_tcp == True:
- if target_os in ['linux', 'tizen', 'android', 'arduino', 'windows']:
+ if target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'windows']:
env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
print "CA Transport is TCP"
else:
if 'NFC' in ca_transport:
env.SConscript(os.path.join(ca_path, 'nfc_adapter/SConscript'))
-if ca_os in ['linux', 'tizen', 'android', 'windows']:
+if ca_os in ['linux', 'tizen', 'android', 'ios', 'windows']:
if with_tcp == True:
env.SConscript(os.path.join(ca_path, 'tcp_adapter/SConscript'))
env.AppendUnique(CPPDEFINES = ['WITH_TCP'])
# Source files to build common for all platforms
common_files = None
-if target_os in ['linux', 'tizen', 'android', 'windows']:
+if target_os in ['linux', 'tizen', 'android', 'ios', 'windows']:
common_files = [
os.path.join(src_dir, 'catcpadapter.c'),
os.path.join(src_dir, 'catcpserver.c') ]
provisioning_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])
-if target_os not in ['msys_nt', 'windows', 'android']:
+if target_os not in ['msys_nt', 'windows', 'android', 'ios']:
provisioning_env.ParseConfig('pkg-config --libs glib-2.0')
if target_os in ['windows', 'msys_nt']:
provisioning_env.AppendUnique(CPPPATH = ['#/extlibs/sqlite3'])
provisioning_src = provisioning_src + ['#/extlibs/sqlite3/sqlite3.c' ]
-if target_os in ['windows', 'msys_nt']:
+if target_os in ['windows', 'msys_nt', 'ios']:
# octbstack.dll is exporting ocpmapi APIs on Windows - there is no ocpmapi.dll.
provisioningserver = provisioning_env.StaticLibrary('ocpmapi', provisioning_src)
else:
oc_logger_libs = []
-if target_os in ['windows', 'msys_nt']:
+if target_os in ['windows', 'msys_nt','ios']:
# If oc_logger APIs have to be exported from a Windows DLL, these functions
# should be exported from octbstack.dll. Building a separate oc_logger.dll here
# would result in duplicated code and data across these two DLLs. Using just
]
ocprovision_env.UserInstallTargetHeader('../include/OCCloudProvisioning.hpp', 'resource', 'OCCloudProvisioning.hpp')
-if target_os not in ['windows']:
+if target_os not in ['ios', 'windows']:
ocprovision = ocprovision_env.SharedLibrary('ocprovision', ocprovision_src)
else:
ocprovision = ocprovision_env.StaticLibrary('ocprovision', ocprovision_src)
((int64_t*)array)[pos] = item;
}
-#if !defined(_MSC_VER)
+#if !(defined(_MSC_VER) || defined(__APPLE__))
template<>
void get_payload_array::copy_to_array(std::_Bit_reference br, void* array, size_t pos)
{
if with_cloud:
oclib_src = oclib_src + ['OCAccountManager.cpp']
-if target_os in ['windows']:
+if target_os in ['windows', 'ios']:
oclib_src = oclib_src + ['OCApi.cpp']
# TODO: Add OC_EXPORT prefixes to enable DLL generation
oclib = oclib_env.StaticLibrary('oc', oclib_src)
oclib_env.UserInstallTargetHeader(header_dir + 'OCAccountManager.h', 'resource', 'OCAccountManager.h')
# Add Provisioning library
-if target_os in ['linux', 'android', 'tizen', 'windows'] and secured == '1':
+if target_os in ['linux', 'android', 'tizen', 'ios', 'windows'] and secured == '1':
SConscript('../provisioning/SConscript')
boost_path = os.path.join(src_dir,'extlibs','boost','boost')
lib_env.AppendUnique(CPPPATH = [boost_path])
elif target_os == 'ios':
+ lib_env.AppendUnique(FRAMEWORKPATH = ['#extlibs/boost/ios/framework'])
lib_env.AppendUnique(FRAMEWORKS = ['boost'])
elif target_os == 'darwin':
lib_env.AppendUnique(CPPPATH = ['/usr/local/include'])
target_os = env.get('TARGET_OS')
-if target_os not in ['arduino','darwin', 'ios', 'windows']:
+if target_os not in ['arduino','darwin', 'windows']:
# Build resource-encapsulation project
SConscript('resource-encapsulation/SConscript')
SConscript('resource-container/SConscript')
# Build scene-manager project
- if target_os in ['linux']:
+ if target_os in ['linux', 'ios']:
SConscript('scene-manager/SConscript')
# Build notification-service project
- if target_os in ['linux','android','tizen']:
+ if target_os in ['linux','android','tizen','ios']:
SConscript('notification/SConscript')
# Build simulator module
SConscript('coap-http-proxy/SConscript')
# Build EasySetup module
-if target_os in ['arduino', 'android', 'linux','tizen']:
+if target_os in ['arduino', 'android', 'ios', 'linux','tizen']:
SConscript('easy-setup/SConscript')
es_target = env.get ('TARGET_OS')
service_easy_setup_env = env.Clone()
-if es_target in ['android', 'linux', 'tizen']:
+if es_target in ['android', 'ios', 'linux', 'tizen']:
SConscript('mediator/SConscript')
if es_target in ['linux', 'tizen']:
if env.get('SECURED') == '1':
easy_setup_env.AppendUnique(LIBS = ['ocpmapi', 'ocprovision'])
-if target_os in ['android','linux','tizen']:
+if target_os in ['android','ios','linux','tizen']:
easy_setup_env.PrependUnique(CPPPATH = [
env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include',
env.get('SRC_DIR') + '/resource/include',
if env.get('WITH_TCP') == True:
easy_setup_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
-if not env.get('RELEASE'):
+if not env.get('RELEASE') and target_os not in ['ios']:
easy_setup_env.PrependUnique(LIBS = ['gcov'])
easy_setup_env.AppendUnique(CCFLAGS = ['--coverage'])
es_src = None
-if target_os in ['android','linux','tizen']:
+if target_os in ['android','ios','linux','tizen']:
if env.get('SECURED') == '1':
env.AppendUnique(es_src = [os.path.join(easysetup_path, 'src/EnrolleeSecurity.cpp')])
env.AppendUnique(es_src = es_common_src)
- es_sdk_shared = easy_setup_env.SharedLibrary('ESMediatorRich', env.get('es_src'))
es_sdk_static = easy_setup_env.StaticLibrary('ESMediatorRich', env.get('es_src'))
- easy_setup_env.InstallTarget([es_sdk_shared, es_sdk_static], 'libESMediatorRich')
- easy_setup_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libESMediatorRich.so'])
+ easy_setup_env.InstallTarget(es_sdk_static, 'libESMediatorRich')
+ if target_os not in ['ios']:
+ es_sdk_shared = easy_setup_env.SharedLibrary('ESMediatorRich', env.get('es_src'))
+ easy_setup_env.InstallTarget(es_sdk_shared, 'libESMediatorRich')
+ easy_setup_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libESMediatorRich.so'])
filenames = [ 'ESException.h', 'ESRichCommon.h', 'EasySetup.hpp', 'RemoteEnrollee.h' ]
for filename in filenames:
notification_consumer_src = [
env.Glob('src/consumer/*.c'), notification_common_obj]
-providersdk = notification_provider_env.SharedLibrary('notification_provider', notification_provider_src)
-notification_provider_env.InstallTarget(providersdk, 'libnotification_provider')
-notification_provider_env.UserInstallTargetLib(providersdk, 'libnotification_provider')
-
-consumersdk = notification_consumer_env.SharedLibrary('notification_consumer', notification_consumer_src)
-notification_consumer_env.InstallTarget(consumersdk, 'libnotification_consumer')
-notification_consumer_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer')
+if target_os not in ['ios']:
+ providersdk = notification_provider_env.SharedLibrary('notification_provider', notification_provider_src)
+ notification_provider_env.InstallTarget(providersdk, 'libnotification_provider')
+ notification_provider_env.UserInstallTargetLib(providersdk, 'libnotification_provider')
+ consumersdk = notification_consumer_env.SharedLibrary('notification_consumer', notification_consumer_src)
+ notification_consumer_env.InstallTarget(consumersdk, 'libnotification_consumer')
+ notification_consumer_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer')
providersdk = notification_provider_env.StaticLibrary('notification_provider', notification_provider_src)
notification_provider_env.InstallTarget(providersdk, 'libnotification_provider')
notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
-if not env.get('RELEASE'):
+if not env.get('RELEASE') and target_os not in ['ios']:
notification_env.PrependUnique(LIBS = ['gcov'])
notification_env.AppendUnique(CCFLAGS = ['--coverage'])
notification_consumer_src = [
env.Glob('src/*.cpp'),notificationCommonSharedObjs]
-consumersdk = notification_env.SharedLibrary('notification_consumer_wrapper', notification_consumer_src)
-notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper')
-notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper')
+if target_os not in ['ios']:
+ consumersdk = notification_env.SharedLibrary('notification_consumer_wrapper', notification_consumer_src)
+ notification_env.InstallTarget(consumersdk, 'libnotification_consumer_wrapper')
+ notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer_wrapper')
notification_consumer_src = [
env.Glob('src/*.cpp'),notificationCommonStaticObjs]
notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
-if not env.get('RELEASE'):
+if not env.get('RELEASE') and target_os not in ['ios']:
notification_env.PrependUnique(LIBS = ['gcov'])
notification_env.AppendUnique(CCFLAGS = ['--coverage'])
notification_provider_src = [
env.Glob('src/*.cpp'),notificationCommonSharedObjs]
-providersdk = notification_env.SharedLibrary('notification_provider_wrapper', notification_provider_src)
-notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
-notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
+if target_os not in ['ios']:
+ providersdk = notification_env.SharedLibrary('notification_provider_wrapper', notification_provider_src)
+ notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
+ notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
notification_provider_src = [
env.Glob('src/*.cpp'),notificationCommonStaticObjs]
res_container_src = [ Glob('src/*.cpp') ]
res_container_static = resource_container_env.StaticLibrary('rcs_container', res_container_src)
-res_container_shared = resource_container_env.SharedLibrary('rcs_container', res_container_src)
-
-resource_container_env.InstallTarget([res_container_static,res_container_shared], 'libResContainer')
-resource_container_env.UserInstallTargetLib([res_container_static,res_container_shared], 'libResContainer')
+if target_os not in ['ios']:
+ res_container_shared = resource_container_env.SharedLibrary('rcs_container', res_container_src)
+ resource_container_env.InstallTarget([res_container_static,res_container_shared], 'libResContainer')
+ resource_container_env.UserInstallTargetLib([res_container_static,res_container_shared], 'libResContainer')
+else:
+ resource_container_env.InstallTarget([res_container_static], 'libResContainer')
+ resource_container_env.UserInstallTargetLib([res_container_static], 'libResContainer')
resource_container_env.UserInstallTargetHeader('include/RCSBundleInfo.h', 'service/resource-container', 'RCSBundleInfo.h')
resource_container_env.UserInstallTargetHeader('include/RCSResourceContainer.h', 'service/resource-container', 'RCSResourceContainer.h')
######################################################################
# Build Container Sample
######################################################################
-containersample_env = resource_container_env.Clone();
-containersample_env.AppendUnique(LINKFLAGS=["-rdynamic"])
+if target_os not in ['ios']:
+ containersample_env = resource_container_env.Clone();
+ containersample_env.AppendUnique(LINKFLAGS=["-rdynamic"])
-# Copy test configuration
-Command("examples/ResourceContainerConfig.xml","examples/ResourceContainerConfig.xml", Copy("$TARGET", "$SOURCE"))
-Ignore("examples/ResourceContainerConfig.xml", "examples/ResourceContainerConfig.xml")
+ # Copy test configuration
+ Command("examples/ResourceContainerConfig.xml","examples/ResourceContainerConfig.xml", Copy("$TARGET", "$SOURCE"))
+ Ignore("examples/ResourceContainerConfig.xml", "examples/ResourceContainerConfig.xml")
-containersample_env.AppendUnique(LIBS = ['rcs_container'])
+ containersample_env.AppendUnique(LIBS = ['rcs_container','resource_directory'])
-containersampleapp_src = ['examples/ContainerSample.cpp']
-containersampleapp = containersample_env.Program('ContainerSample',containersampleapp_src)
-Alias("containersample", containersampleapp)
-env.AppendTarget('containersample')
+ containersampleapp_src = ['examples/ContainerSample.cpp']
+ containersampleapp = containersample_env.Program('ContainerSample',containersampleapp_src)
+ Alias("containersample", containersampleapp)
+ env.AppendTarget('containersample')
######################################################################
# Build Container Sample Client
######################################################################
-containersampleclient_env = resource_container_env.Clone();
+ containersampleclient_env = resource_container_env.Clone();
-containersample_env.AppendUnique(LIBS = ['rcs_container'])
-containersampleclient_src = ['examples/ContainerSampleClient.cpp']
-containersampleclientapp = containersample_env.Program('ContainerSampleClient',containersampleclient_src)
-Alias("containersampleclient", containersampleclientapp)
-env.AppendTarget('containersampleclient')
+ containersample_env.AppendUnique(LIBS = ['rcs_container'])
+ containersampleclient_src = ['examples/ContainerSampleClient.cpp']
+ containersampleclientapp = containersample_env.Program('ContainerSampleClient',containersampleclient_src)
+ Alias("containersampleclient", containersampleclientapp)
+ env.AppendTarget('containersampleclient')
######################################################################
# Build Container Java SDK
RESOURCECLIENT_DIR + 'RCSRemoteResourceObject.cpp'
]
ResourceClientsdk_static = resourceClient_env.StaticLibrary('rcs_client', client_src)
-ResourceClientsdk_shared = resourceClient_env.SharedLibrary('rcs_client', client_src)
-
-resourceClient_env.InstallTarget([ResourceClientsdk_static,ResourceClientsdk_shared], 'rcs_client')
-resourceClient_env.UserInstallTargetLib([ResourceClientsdk_static,ResourceClientsdk_shared], 'rcs_client')
+if target_os not in ['ios']:
+ ResourceClientsdk_shared = resourceClient_env.SharedLibrary('rcs_client', client_src)
+ resourceClient_env.InstallTarget([ResourceClientsdk_static,ResourceClientsdk_shared], 'rcs_client')
+ resourceClient_env.UserInstallTargetLib([ResourceClientsdk_static,ResourceClientsdk_shared], 'rcs_client')
+else:
+ resourceClient_env.InstallTarget([ResourceClientsdk_static], 'rcs_client')
+ resourceClient_env.UserInstallTargetLib([ResourceClientsdk_static], 'rcs_client')
resourceClient_env.UserInstallTargetHeader('include/RCSAddress.h', 'service/resource-encapsulation', 'RCSAddress.h')
resourceClient_env.UserInstallTargetHeader('include/RCSDiscoveryManager.h', 'service/resource-encapsulation', 'RCSDiscoveryManager.h')
resourceClient_env.UserInstallTargetHeader('include/RCSRemoteResourceObject.h', 'service/resource-encapsulation', 'RCSRemoteResourceObject.h')
]
rcs_common_static = rcs_common_env.StaticLibrary('rcs_common', rcs_common_src)
-rcs_common_shared = rcs_common_env.SharedLibrary('rcs_common', rcs_common_src)
-rcs_common_env.InstallTarget([rcs_common_static,rcs_common_shared], 'rcs_common')
-rcs_common_env.UserInstallTargetLib([rcs_common_static,rcs_common_shared], 'rcs_common')
+if target_os not in ['ios']:
+ rcs_common_shared = rcs_common_env.SharedLibrary('rcs_common', rcs_common_src)
+ rcs_common_env.InstallTarget([rcs_common_static,rcs_common_shared], 'rcs_common')
+ rcs_common_env.UserInstallTargetLib([rcs_common_static,rcs_common_shared], 'rcs_common')
+else:
+ rcs_common_env.InstallTarget([rcs_common_static], 'rcs_common')
+ rcs_common_env.UserInstallTargetLib([rcs_common_static], 'rcs_common')
######################################################################
# Build Test Expiry Timer and primitive Resource
#include "ResourcePresence.h"
+#if (defined(__APPLE__) && defined(TARGET_OS_IPHONE))
+#include <atomic>
+#else
#ifndef __APPLE__
#ifndef TARGET_OS_MAC
#include <bits/atomic_base.h>
#include <bits/shared_ptr_base.h>
#endif
#endif
+#endif
#include <time.h>
#include <unistd.h>
#include <cstdbool>
server_builder_src = server_builder_env.Glob('src/*.cpp')
server_builder_static = server_builder_env.StaticLibrary('rcs_server', server_builder_src)
-server_builder_shared = server_builder_env.SharedLibrary('rcs_server', server_builder_src)
-
-server_builder_env.InstallTarget([server_builder_static, server_builder_shared], 'rcs_server')
-server_builder_env.UserInstallTargetLib([server_builder_static, server_builder_shared], 'rcs_server')
+if target_os not in ['ios']:
+ server_builder_shared = server_builder_env.SharedLibrary('rcs_server', server_builder_src)
+ server_builder_env.InstallTarget([server_builder_static, server_builder_shared], 'rcs_server')
+ server_builder_env.UserInstallTargetLib([server_builder_static, server_builder_shared], 'rcs_server')
+else:
+ server_builder_env.InstallTarget([server_builder_static], 'rcs_server')
+ server_builder_env.UserInstallTargetLib([server_builder_static], 'rcs_server')
######################################################################
# Build Test
scenemanager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
scenemanager_env.AppendUnique(LIBS = ['gnustl_shared','log'])
-if not env.get('RELEASE'):
+if not env.get('RELEASE') and target_os not in ['ios']:
scenemanager_env.PrependUnique(LIBS = ['gcov'])
scenemanager_env.AppendUnique(CXXFLAGS = ['--coverage'])
lib_env.AppendUnique(CCFLAGS = ['-w'])
elif target_os == 'ios':
- lib_env.AppendUnique(FRAMEWORKS = ['boost', 'openssl'])
+ lib_env.AppendUnique(FRAMEWORKPATH = ['#extlibs/boost/ios/framework'])
+ lib_env.AppendUnique(FRAMEWORKS = ['boost'])
elif target_os == 'darwin':
lib_env.AppendUnique(CPPPATH = ['/usr/local/include'])
lib_env.AppendUnique(LIBPATH = ['/usr/local/lib'])