Merge branch 'master' into simulator
[platform/upstream/iotivity.git] / resource / provisioning / SConscript
1 #******************************************************************
2 #
3 # Copyright 2015 Samsung Electronics All Rights Reserved.
4 #
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #
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
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 Import('env')
22
23 ocprovision_env = env.Clone()
24
25 ######################################################################
26 # Build flags
27 ######################################################################
28 ocprovision_env.AppendUnique(CPPPATH = [
29                 '../include/',
30         '../csdk/stack/include',
31         '../csdk/logger/include',
32         '../oc_logger/include',
33                 '../csdk/security/include',
34                 '../csdk/security/provisioning/include',
35                 '../csdk/security/provisioning/include/oxm',
36                 '../csdk/security/provisioning/include/internal'
37                 ])
38
39 target_os = env.get('TARGET_OS')
40 if target_os not in ['windows', 'winrt']:
41         ocprovision_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC'])
42
43 if target_os == 'android':
44         ocprovision_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
45         ocprovision_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
46         ocprovision_env.AppendUnique(LIBS = ['ocspapi', 'octbstack', 'oc_logger', 'boost_thread', 'gnustl_shared', 'log'])
47
48 if target_os in ['darwin', 'ios']:
49         ocprovision_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
50         ocprovision_env.AppendUnique(LIBS = ['octbstack', 'oc_logger'])
51
52 ######################################################################
53 # Source files and Targets
54 ######################################################################
55 ocprovision_src = [
56                 'src/OCProvisioningManager.cpp'
57         ]
58
59 ocprovision = ocprovision_env.StaticLibrary('ocprovision', ocprovision_src)
60 ocprovision_env.InstallTarget(ocprovision, 'libocprovision')
61
62 if target_os in ['linux']:
63     SConscript('examples/SConscript')