Merge branch 'master' into simulator
[platform/upstream/iotivity.git] / resource / csdk / stack / samples / tizen / SimpleClientServer / scons / SConscript
1 #******************************************************************
2 #
3 # Copyright 2014 Intel Mobile Communications GmbH 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 target_os = env.get('TARGET_OS')
24 transport = env.get('TARGET_TRANSPORT')
25 secured = env.get('SECURED')
26 routing = env.get('ROUTING')
27 OIC_LIB = 'oic'
28 root_dir = env.get('ROOT_DIR')
29 build_dir = env.get('BUILD_DIR')
30 sample_dir = build_dir
31
32 env.AppendUnique(CPPFLAGS = ['-std=c++0x', '-fPIC', '-D__TIZEN__','-DWITH_POSIX', '-Wall', '-DSLP_SDK_LOG', '-g','-D_GNU_SOURCE','-DTIZEN_DEBUG_ENABLE', '-DTB_LOG','`pkg-config', '--cflags', '--libs','dlog', 'com.oic.ri', 'capi-network-wifi',
33                                 'gobject-2.0','glib-2.0`'])
34
35 if routing == 'GW':
36         env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
37 elif routing == 'EP':
38         env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
39
40 env.Append(LIBS=[
41   '-lm', '-lpthread', '-lrt', '-ldl', '-lstdc++', '-lgobject-2.0', '-lgio-2.0', '-lglib-2.0', '-lcapi-network-wifi', '-ldlog', '-lcapi-network-bluetooth', '-lconnectivity_abstraction', 'coap', '-loctbstack', 'ocsrm', 'c_common'
42 ])
43
44 if secured == '1':
45         env.PrependUnique(CPPPATH = [root_dir + '/external/inc/'])
46         env.AppendUnique(CPPDEFINES = ['__WITH_DTLS__'])
47         env.Append(LIBS=['-ltinydtls'])
48
49 if 'ALL' in transport:
50                 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER','BT_ADAPTER_TEST','BLE_ADAPTER_TEST'])
51                 print "CA Transport is ALL"
52 else:
53         if 'BT' in transport:
54                 env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER','BT_ADAPTER_TEST'])
55                 print "CA Transport is BT"
56         else:
57                 env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
58
59         if 'BLE' in transport:
60                 env.AppendUnique(CPPDEFINES = ['LE_ADAPTER','BLE_ADAPTER_TEST'])
61                 print "CA Transport is BLE"
62         else:
63                 env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
64
65         if 'IP' in transport:
66                 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
67                 print "CA Transport is IP"
68         else:
69                 env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
70
71 #ri_sample_src = [sample_dir + '/occlient.cpp']
72
73 #print " ri sample src %s" % ri_sample_src
74
75 #env.Program('ri_sample', [ri_sample_src,])
76
77 env.Program('occlient', [sample_dir + 'occlient.cpp', sample_dir + 'common.cpp'])
78 env.Program('ocserver', [sample_dir + 'ocserver.cpp', sample_dir + 'common.cpp'])
79 env.Program('ocrouting', [sample_dir + 'ocrouting.cpp', sample_dir + 'common.cpp'])