summaryrefslogtreecommitdiff
path: root/service/easy-setup/sampleapp/mediator/linux/richsdk_sample/SConscript
blob: 2f422a2f05e3535fce1bc708fb8a8be27685228d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#******************************************************************
#
# Copyright 2016 Samsung Electronics All Rights Reserved.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Import('env')

mediator_env = env.Clone()

target_os = env.get('TARGET_OS')

######################################################################
# Build flags
######################################################################
mediator_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])

if env.get('RELEASE'):
    mediator_env.AppendUnique(CCFLAGS = ['-Os'])
    mediator_env.AppendUnique(CPPDEFINES = ['NDEBUG'])
else:
    mediator_env.AppendUnique(CCFLAGS = ['-g'])

if env.get('LOGGING'):
    env.AppendUnique(CPPDEFINES = ['TB_LOG'])

env.AppendUnique(CPPDEFINES = ['CPP_MEDIATOR'])

if target_os not in ['windows']:
    mediator_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x'])

mediator_env.PrependUnique(CPPPATH = [
            env.get('SRC_DIR') + '/resource/include',
            env.get('SRC_DIR') + '/resource/oc_logger/include',
			env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include',
			env.get('SRC_DIR') + '/resource/csdk/stack/include',
			env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include',
			env.get('SRC_DIR') + '/resource/csdk/security/provisioning/include/internal',
			env.get('SRC_DIR') + '/resource/csdk/logger/include',
			env.get('SRC_DIR') + '/resource/csdk/security/include',
			env.get('SRC_DIR') + '/resource/csdk/connectivity/api',
			env.get('SRC_DIR') + '/extlibs/cjson',
			env.get('SRC_DIR') + '/service/easy-setup/mediator/richsdk/inc',
			env.get('SRC_DIR') + '/service/easy-setup/mediator/richsdk/src',
			env.get('SRC_DIR') + '/service/easy-setup/inc'])

if env.get('SECURED') == '1':
	mediator_env.PrependUnique(LIBS = ['mbedtls', 'mbedx509','mbedcrypto'])

mediator_env.PrependUnique(LIBS = ['ESMediatorRich', 'oc', 'octbstack', 'oc_logger', 'connectivity_abstraction'])

if env.get('SECURED') == '1':
	mediator_env.PrependUnique(LIBS = ['ocpmapi', 'ocprovision'])

mediator = mediator_env.Program('mediator_rich', 'mediator_cpp.cpp')

i_mediator = mediator_env.Install(env.get('BUILD_DIR'), mediator)

clientdat = mediator_env.Install(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample',
                                    env.get('SRC_DIR') + '/service/easy-setup/sampleapp/mediator/linux/richsdk_sample/oic_svr_db_client.dat')


Alias('mediator_rich', [i_mediator, clientdat])
env.AppendTarget('mediator_rich')