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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 # Resource Directory build script
28 if rd_env.get('LOGGING'):
29 rd_env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
31 target_os = env.get('TARGET_OS')
32 src_dir = env.get('SRC_DIR')
33 rd_mode = env.get('RD_MODE')
35 ######################################################################
37 ######################################################################
38 rd_env.AppendUnique(CPPPATH = ['include', 'src/internal', '../stack/include', '../../oc_logger/include'])
40 if 'CLIENT' in rd_mode:
41 rd_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
42 if 'SERVER' in rd_mode:
43 rd_env.AppendUnique(CPPDEFINES = ['RD_SERVER'])
45 rd_env.AppendUnique(LIBPATH = [rd_env.get('BUILD_DIR')])
46 rd_env.AppendUnique(LIBS = ['octbstack'])
48 if target_os not in ['windows']:
49 rd_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra'])
51 if target_os in ['linux']:
52 rd_env.AppendUnique(LIBS = ['pthread'])
54 if target_os == 'android':
55 rd_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
56 rd_env.AppendUnique(LIBS = ['gnustl_static'])
58 if not env.get('RELEASE'):
59 rd_env.AppendUnique(LIBS = ['log'])
61 if target_os in ['linux', 'tizen']:
62 rd_env.ParseConfig('pkg-config --cflags --libs sqlite3')
64 rd_env.AppendUnique(CPPPATH = ['../../../extlibs/sqlite3'])
66 ######################################################################
67 # Source files and Targets
68 ######################################################################
72 if 'SERVER' in rd_mode:
74 RD_SRC_DIR + 'internal/rd_database.c',
75 RD_SRC_DIR + 'rd_server.c',
77 if target_os not in ['linux', 'tizen'] :
78 rd_src += [ '../../../extlibs/sqlite3/sqlite3.c' ]
80 if 'CLIENT' in rd_mode:
81 rd_src += [RD_SRC_DIR + 'rd_client.c',]
83 if target_os in ['tizen'] :
84 rdsdk = rd_env.SharedLibrary('resource_directory', rd_src)
86 rdsdk = rd_env.StaticLibrary('resource_directory', rd_src)
88 rd_env.InstallTarget(rdsdk, 'resource_directory')
89 rd_env.UserInstallTargetLib(rdsdk, 'resource_directory')
91 if 'CLIENT' in rd_mode:
92 rd_env.UserInstallTargetHeader('include/rd_client.h', 'service/resource-directory', 'rd_client.h')
94 if 'SERVER' in rd_mode:
95 rd_env.UserInstallTargetHeader('include/rd_server.h', 'service/resource-directory', 'rd_server.h')
96 rd_env.UserInstallTargetHeader('include/rd_database.h', 'service/resource-directory', 'rd_database.h')
98 ######################################################################
99 # Samples for the resource directory
100 ######################################################################
101 if target_os in ['linux']:
102 SConscript('samples/SConscript')
104 ######################################################################
105 # Build UnitTests Things Manager
106 ################################################ ######################
107 if target_os in ['linux']:
108 SConscript('unittests/SConscript')