1 #******************************************************************
\r
3 # Copyright 2015 Samsung Electronics All Rights Reserved.
\r
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
7 # Licensed under the Apache License, Version 2.0 (the "License");
\r
8 # you may not use this file except in compliance with the License.
\r
9 # You may obtain a copy of the License at
\r
11 # http://www.apache.org/licenses/LICENSE-2.0
\r
13 # Unless required by applicable law or agreed to in writing, software
\r
14 # distributed under the License is distributed on an "AS IS" BASIS,
\r
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 # See the License for the specific language governing permissions and
\r
17 # limitations under the License.
\r
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
\r
22 # rcs_common (primitiveResource and expiryTimer) build script
\r
27 # Add third party libraries
\r
28 lib_env = env.Clone()
\r
29 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env')
\r
31 src_dir = lib_env.get('SRC_DIR')
\r
33 gtest_dir = src_dir + '/extlibs/gtest/gtest-1.7.0'
\r
35 rcs_common_env = lib_env.Clone()
\r
36 target_os = env.get('TARGET_OS')
\r
38 release = env.get('RELEASE')
\r
40 ######################################################################
\r
42 ######################################################################
\r
43 rcs_common_env.AppendUnique(CPPPATH = [
\r
44 env.get('SRC_DIR')+'/extlibs',
\r
46 'primitiveResource/include'])
\r
48 rcs_common_env.AppendUnique(CPPPATH = [
\r
49 'expiryTimer/include',
\r
52 rcs_common_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
\r
54 if target_os not in ['windows', 'winrt']:
\r
55 rcs_common_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
\r
56 if target_os != 'android':
\r
57 rcs_common_env.AppendUnique(CXXFLAGS = ['-pthread'])
\r
58 rcs_common_env.AppendUnique(LIBS = ['pthread'])
\r
60 if target_os == 'android':
\r
61 rcs_common_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
\r
62 rcs_common_env.PrependUnique(LIBS = ['gnustl_shared', 'compatibility', 'log'])
\r
64 rcs_common_env.AppendUnique(LIBS = ['dl'])
\r
67 rcs_common_env.AppendUnique(CXXFLAGS = ['--coverage'])
\r
68 rcs_common_env.PrependUnique(LIBS = ['gcov'])
\r
70 ######################################################################
\r
71 # Source files and Targets
\r
72 ######################################################################
\r
73 TIMER_SRC_DIR = 'expiryTimer/src/'
\r
74 RESOURCE_SRC = 'primitiveResource/src/'
\r
76 TIMER_SRC_DIR + 'ExpiryTimerImpl.cpp',
\r
77 TIMER_SRC_DIR + 'ExpiryTimer.cpp',
\r
78 RESOURCE_SRC + 'PresenceSubscriber.cpp',
\r
79 RESOURCE_SRC + 'PrimitiveResource.cpp',
\r
80 RESOURCE_SRC + 'RCSException.cpp',
\r
81 RESOURCE_SRC + 'RCSAddress.cpp',
\r
82 RESOURCE_SRC + 'RCSResourceAttributes.cpp',
\r
83 RESOURCE_SRC + 'ResponseStatement.cpp'
\r
86 rcs_common_static = rcs_common_env.StaticLibrary('rcs_common', rcs_common_src)
\r
87 rcs_common_shared = rcs_common_env.SharedLibrary('rcs_common', rcs_common_src)
\r
88 rcs_common_env.InstallTarget([rcs_common_static,rcs_common_shared], 'rcs_common')
\r
90 ######################################################################
\r
91 # Build Test primitive Resource
\r
92 ######################################################################
\r
93 rcs_common_test_env = rcs_common_env.Clone();
\r
95 rcs_common_test_env.PrependUnique(CPPPATH = [
\r
96 env.get('SRC_DIR')+'/extlibs/hippomocks-master',
\r
97 gtest_dir + '/include',
\r
101 gtest = File(gtest_dir + '/lib/.libs/libgtest.a')
\r
102 gtest_main = File(gtest_dir + '/lib/.libs/libgtest_main.a')
\r
104 rcs_common_test_env.PrependUnique(LIBS = [
\r
108 'connectivity_abstraction',
\r
116 rcs_common_test_src = [
\r
117 env.Glob('primitiveResource/unittests/*.cpp'),
\r
118 'expiryTimer/unittests/ExpiryTimerTest.cpp'
\r
121 rcs_common_test = rcs_common_test_env.Program('rcs_common_test', rcs_common_test_src)
\r
122 Alias("rcs_common_test", rcs_common_test)
\r
123 env.AppendTarget('rcs_common_test')
\r
125 if env.get('TEST') == '1':
126 target_os = env.get('TARGET_OS')
127 if target_os == 'linux':
128 from tools.scons.RunTest import *
129 run_test(rcs_common_test_env, '',
130 'service/resource-encapsulation/src/common/rcs_common_test')