99267150ac33eb5b0373f1c151c37ac7316392bf
[platform/upstream/iotivity.git] / service / easy-setup / sampleapp / mediator / linux / 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 Import('env')
22
23 mediator_env = env.Clone()
24
25 target_os = env.get('TARGET_OS')
26
27 ######################################################################
28 # Build flags
29 ######################################################################
30 mediator_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
31
32 if env.get('RELEASE'):
33     mediator_env.AppendUnique(CCFLAGS = ['-Os'])
34     mediator_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
35 else:
36     mediator_env.AppendUnique(CCFLAGS = ['-g'])
37
38 if env.get('LOGGING'):
39     env.AppendUnique(CPPDEFINES = ['TB_LOG'])
40
41
42 if target_os not in ['windows', 'winrt']:
43     mediator_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])
44     
45 mediator_env.PrependUnique(CPPPATH = [
46             env.get('SRC_DIR') + '/resource/include',
47             env.get('SRC_DIR') + '/resource/oc_logger/include',
48                         env.get('SRC_DIR') + '/resource/csdk/ocmalloc/include',         
49                         env.get('SRC_DIR') + '/resource/csdk/stack/include',
50                         env.get('SRC_DIR') + '/resource/csdk/logger/include',
51                         env.get('SRC_DIR') + '/resource/csdk/security/include',
52                         env.get('SRC_DIR') + '/extlibs/cjson',
53                         env.get('SRC_DIR') + '/service/easy-setup/sdk/mediator/include',
54                         env.get('SRC_DIR') + '/service/easy-setup/sdk/mediator/src',
55                         env.get('SRC_DIR') + '/service/easy-setup/sdk/common'])
56
57 mediator_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction', 'coap', 'ESSDKLibrary'])
58 if env.get('SECURED') == '1':
59         mediator_env.PrependUnique(LIBS = ['ocpmapi', 'ocprovision'])
60
61
62 mediator = mediator_env.Program('mediator', 'mediator_cpp.cpp')
63
64 i_mediator = mediator_env.Install(env.get('BUILD_DIR'), mediator)
65
66 Alias('mediator', i_mediator)
67 env.AppendTarget('mediator')