IOT-1072 Unfork libcoap: add build flag
[platform/upstream/iotivity.git] / resource / csdk / stack / samples / tizen / build / SConscript
1 ##
2 # CA build script
3 ##
4
5 SConscript('./resource/csdk/connectivity/build/SConscript')
6
7 Import('env')
8
9 target_os = env.get('TARGET_OS')
10 transport = env.get('TARGET_TRANSPORT')
11 buildsample = env.get('BUILD_SAMPLE')
12 release_mode = env.get('RELEASE')
13 secured = env.get('SECURED')
14 logging = env.get('LOGGING')
15 routing = env.get('ROUTING')
16 with_proxy = env.get('WITH_PROXY')
17 with_tcp = env.get('WITH_TCP')
18
19 with_upstream_libcoap = env.get('WITH_UPSTREAM_LIBCOAP')
20 if with_upstream_libcoap == '1':
21         # For bring up purposes only, we manually copy the forked version to where the unforked version is downloaded.
22         env.AppendUnique(CPPPATH = ['#extlibs/libcoap/libcoap/include'])
23 else:
24         # For bring up purposes only, the forked version will live here.
25         env.AppendUnique(CPPPATH = ['../../../../connectivity/lib/libcoap-4.1.1'])
26
27 env.PrependUnique(CPPPATH = [
28                 '../../../../logger/include',
29                 '../../../../stack/include',
30                 '../../../../../../extlibs/cjson',
31                 '../../../../../oc_logger/include'
32                 ])
33
34 env.AppendUnique(CPPDEFINES = ['TB_LOG'])
35 if routing == 'GW':
36         env.AppendUnique(CPPDEFINES = ['ROUTING_GATEWAY'])
37 elif routing == 'EP':
38         env.AppendUnique(CPPDEFINES = ['ROUTING_EP'])
39 env.AppendUnique(CPPDEFINES = ['__TIZEN__'])
40
41 if env.get('WITH_PROXY'):
42         env.AppendUnique(CPPDEFINES = ['WITH_CHPROXY'])
43
44 print "Given Transport is %s" % transport
45 print "Given OS is %s" % target_os
46
47 if target_os == 'tizen':
48         command = "sh resource/csdk/stack/samples/tizen/build/gbsbuild.sh %s %s %s %s %s %s %s %s" % (transport, secured, buildsample, release_mode, logging, routing, with_tcp, with_proxy)
49         print "Created Command is %s" % command
50         gbs_script = env.Command('gbs_build', None, command)
51         AlwaysBuild ('gbs_script')