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 '../../extlibs/cjson/'
50 target_os = ocprovision_env.get('TARGET_OS')
51 if target_os not in ['windows']:
52 ocprovision_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC'])
54 if target_os == 'android':
55 ocprovision_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
56 ocprovision_env.AppendUnique(LIBPATH = [ocprovision_env.get('BUILD_DIR')])
57 ocprovision_env.AppendUnique(LIBS = ['oc', 'octbstack', 'ocpmapi', 'oc_logger', 'boost_thread', 'gnustl_shared', 'log'])
59 if target_os in ['linux', 'tizen']:
60 ocprovision_env.AppendUnique(LIBPATH = [ocprovision_env.get('BUILD_DIR')])
61 ocprovision_env.AppendUnique(LIBS = ['oc', 'octbstack', 'ocpmapi', 'oc_logger', 'boost_thread'])
63 if target_os in ['darwin', 'ios']:
64 ocprovision_env.AppendUnique(LIBPATH = [ocprovision_env.get('BUILD_DIR')])
65 ocprovision_env.AppendUnique(LIBS = ['octbstack', 'oc_logger'])
67 ######################################################################
68 # Source files and Targets
69 ######################################################################
71 'src/OCProvisioningManager.cpp'
74 ocprovision = ocprovision_env.SharedLibrary('ocprovision', ocprovision_src)
75 ocprovision_env.InstallTarget(ocprovision, 'libocprovision')
76 ocprovision_env.UserInstallTargetLib(ocprovision, 'libocprovision')
78 if target_os in ['linux', 'tizen']:
79 SConscript('examples/SConscript')