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
27 if env.get('RELEASE'):
28 env.AppendUnique(CCFLAGS = ['-Os'])
29 env.AppendUnique(CPPDEFINES = ['NDEBUG'])
31 env.AppendUnique(CCFLAGS = ['-g'])
33 if env.get('LOGGING'):
34 env.AppendUnique(CPPDEFINES = ['-DTB_LOG'])
37 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
38 rd_env = lib_env.Clone()
40 target_os = env.get('TARGET_OS')
41 ######################################################################
43 ######################################################################
44 rd_env.AppendUnique(CPPPATH = ['include'])
45 rd_env.AppendUnique(CPPPATH = ['src/internal'])
46 rd_env.AppendUnique(CPPPATH = ['../../resource/csdk/logger/include'])
47 rd_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'libcoap'])
49 if target_os not in ['windows', 'winrt']:
50 rd_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-Wextra'])
52 if target_os == 'linux':
53 rd_env.AppendUnique(LIBS = ['pthread'])
55 if target_os == 'android':
56 rd_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
57 rd_env.AppendUnique(LIBS = ['gnustl_static'])
59 if not env.get('RELEASE'):
60 rd_env.AppendUnique(LIBS = ['log'])
62 ######################################################################
63 # Source files and Targets
64 ######################################################################
67 RD_SRC_DIR + '/internal/rd_storage.c',
68 RD_SRC_DIR + 'rd_server.c',
69 RD_SRC_DIR + 'rd_client.c',
72 if target_os in ['tizen'] :
73 rdsdk = rd_env.SharedLibrary('resource_directory', rd_src)
75 rdsdk = rd_env.StaticLibrary('resource_directory', rd_src)
77 rd_env.InstallTarget(rdsdk, 'libresource_directory')
78 rd_env.UserInstallTargetLib(rdsdk, 'libresource_directory')
79 rd_env.UserInstallTargetHeader('/include/rd_client.h', 'service/resource-directory', 'rd_client.h')
80 rd_env.UserInstallTargetHeader('/include/rd_server.h', 'service/resource-directory', 'rd_server.h')
82 ######################################################################
83 # Samples for the resource directory
84 ######################################################################
85 SConscript('samples/SConscript')