Add more provisioning status and error code in provisioning resource
[platform/upstream/iotivity.git] / service / resource-directory / 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 ##
22 # Resource Directory build script
23 ##
24
25 Import('env')
26 rd_env = env.Clone()
27
28 if rd_env.get('LOGGING'):
29     rd_env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
30
31 target_os = env.get('TARGET_OS')
32 src_dir = env.get('SRC_DIR')
33
34 ######################################################################
35 # Build flags
36 ######################################################################
37 rd_env.AppendUnique(CPPPATH = ['include'])
38 rd_env.AppendUnique(CPPPATH = ['src/internal'])
39 rd_env.AppendUnique(CPPPATH = ['../../resource/csdk/stack/include'])
40 rd_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap'])
41
42 if target_os not in ['windows']:
43     rd_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra'])
44
45 if target_os in ['linux']:
46     rd_env.AppendUnique(LIBS = ['pthread'])
47
48 if target_os == 'android':
49     rd_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
50     rd_env.AppendUnique(LIBS = ['gnustl_static'])
51
52     if not env.get('RELEASE'):
53         rd_env.AppendUnique(LIBS = ['log'])
54
55 ######################################################################
56 # Source files and Targets
57 ######################################################################
58 RD_SRC_DIR = 'src/'
59 rd_src = [
60         RD_SRC_DIR + 'internal/rd_storage.c',
61         RD_SRC_DIR + 'rd_server.c',
62         RD_SRC_DIR + 'rd_client.c',
63          ]
64
65 if target_os in ['tizen'] :
66     rdsdk = rd_env.SharedLibrary('resource_directory', rd_src)
67 else :
68     rdsdk = rd_env.StaticLibrary('resource_directory', rd_src)
69
70 rd_env.InstallTarget(rdsdk, 'resource_directory')
71 rd_env.UserInstallTargetLib(rdsdk, 'resource_directory')
72 rd_env.UserInstallTargetHeader('include/rd_client.h', 'service/resource-directory', 'rd_client.h')
73 rd_env.UserInstallTargetHeader('include/rd_server.h', 'service/resource-directory', 'rd_server.h')
74
75 ######################################################################
76 # Samples for the resource directory
77 ######################################################################
78 if target_os not in ['windows']:
79     SConscript('samples/SConscript')