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 # things_manager project build script
27 # Add third party libraries
29 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env')
31 src_dir = lib_env.get('SRC_DIR')
33 service_common_env = lib_env.Clone()
34 target_os = env.get('TARGET_OS')
36 release = env.get('RELEASE')
38 ######################################################################
40 ######################################################################
41 service_common_env.AppendUnique(CPPPATH = [env.get('SRC_DIR')+'/extlibs', 'include', 'src'])
43 if target_os not in ['windows', 'winrt']:
44 service_common_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
45 if target_os != 'android':
46 service_common_env.AppendUnique(CXXFLAGS = ['-pthread'])
48 if target_os == 'android':
49 service_common_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
50 service_common_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
52 service_common_env.AppendUnique(LIBS = ['dl'])
55 service_common_env.AppendUnique(CXXFLAGS = ['--coverage'])
56 service_common_env.PrependUnique(LIBS = ['gcov'])
58 ######################################################################
59 # Source files and Targets
60 ######################################################################
61 service_common_src = env.Glob('src/*.cpp')
62 service_common_static = service_common_env.StaticLibrary('ServiceCommon', service_common_src)
63 service_common_shared = service_common_env.SharedLibrary('ServiceCommon', service_common_src)
65 service_common_env.InstallTarget([service_common_static,service_common_shared], 'libServiceCommon')
67 ######################################################################
69 ######################################################################
70 service_common_test_env = service_common_env.Clone();
71 service_common_test_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
73 gtest = File(src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs/libgtest.a')
74 gtest_main = File(src_dir + '/extlibs/gtest/gtest-1.7.0/lib/.libs/libgtest_main.a')
76 service_common_test_env.PrependUnique(LIBS = [
80 'connectivity_abstraction',
87 service_common_test_src = env.Glob('unittests/*.cpp')
89 service_common_test = service_common_test_env.Program('service_common_test', service_common_test_src)
90 Alias("service_common_test", service_common_test)
91 env.AppendTarget('service_common_test')