1 #******************************************************************
3 # Copyright 2015 Samsung Electronics All Rights Reserved.
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
23 ocprovision_env = env.Clone()
25 ######################################################################
27 ######################################################################
28 with_upstream_libcoap = ocprovision_env.get('WITH_UPSTREAM_LIBCOAP')
29 if with_upstream_libcoap == '1':
30 # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded.
31 ocprovision_env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
33 # For bring up purposes only, the forked version will live here.
34 ocprovision_env.AppendUnique(CPPPATH = ['../csdk/connectivity/lib/libcoap-4.1.1/include'])
36 ocprovision_env.AppendUnique(CPPPATH = [
38 '../csdk/stack/include',
39 '../csdk/logger/include',
40 '../oc_logger/include',
41 '../csdk/connectivity/api',
42 '../csdk/security/include',
43 '../csdk/connectivity/inc/pkix',
44 '../csdk/security/provisioning/include',
45 '../csdk/security/provisioning/include/oxm',
46 '../csdk/security/provisioning/include/internal',
47 '../csdk/security/provisioning/include/cloud',
48 '../csdk/connectivity/lib/libcoap-4.1.1/',
49 '../../extlibs/cjson/'
52 target_os = ocprovision_env.get('TARGET_OS')
53 if target_os not in ['windows']:
54 ocprovision_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC'])
56 if target_os == 'android':
57 ocprovision_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
58 ocprovision_env.AppendUnique(LIBPATH = [ocprovision_env.get('BUILD_DIR')])
59 ocprovision_env.AppendUnique(LIBS = ['oc', 'octbstack', 'ocpmapi', 'oc_logger', 'boost_thread', 'gnustl_shared', 'log'])
61 if target_os in ['linux', 'tizen']:
62 ocprovision_env.AppendUnique(LIBPATH = [ocprovision_env.get('BUILD_DIR')])
63 ocprovision_env.AppendUnique(LIBS = ['oc', 'octbstack', 'ocpmapi', 'oc_logger', 'boost_thread'])
65 if target_os in ['darwin', 'ios']:
66 ocprovision_env.AppendUnique(LIBPATH = [ocprovision_env.get('BUILD_DIR')])
67 ocprovision_env.AppendUnique(LIBS = ['octbstack', 'oc_logger'])
69 ######################################################################
70 # Source files and Targets
71 ######################################################################
73 'src/OCProvisioningManager.cpp'
76 if ocprovision_env.get('WITH_TCP') == True:
77 ocprovision_src = ocprovision_src + [
78 'src/OCCloudProvisioning.cpp'
81 ocprovision = ocprovision_env.SharedLibrary('ocprovision', ocprovision_src)
82 ocprovision_env.InstallTarget(ocprovision, 'libocprovision')
83 ocprovision_env.UserInstallTargetLib(ocprovision, 'libocprovision')
85 if target_os in ['linux', 'tizen']:
86 SConscript('examples/SConscript')