Add freature of Scheduled Group Action.
[platform/upstream/iotivity.git] / resource / csdk / SConscript
1 ##
2 # liboctbstack (share library) build script
3 ##
4 Import('env')
5
6 liboctbstack_env = env.Clone()
7
8 target_os = env.get('TARGET_OS')
9 # As in the source code, it includes arduino Time library (C++)
10 # It requires compile the .c with g++
11 if target_os == 'arduino':
12         liboctbstack_env.Replace(CC = env.get('CXX'))
13         liboctbstack_env.Replace(CFLAGS = env.get('CXXFLAGS'))
14
15 ######################################################################
16 # Build flags
17 ######################################################################
18 liboctbstack_env.PrependUnique(CPPPATH = [
19                 '../../extlibs/cjson/',
20                 '../../extlibs/timer/',
21                 'ocsocket/include',
22                 'logger/include',
23                 'ocrandom/include',
24                 'ocmalloc/include',
25                 'libcoap',
26                 'occoap/include',
27                 'stack/include',
28                 'stack/include/internal',
29                 '../oc_logger/include'
30                 ])
31
32 if target_os not in ['arduino', 'windows', 'winrt']:
33         liboctbstack_env.AppendUnique(CPPDEFINES  = ['WITH_POSIX'])
34         liboctbstack_env.AppendUnique(CFLAGS = ['-std=c99'])
35
36 if target_os not in ['windows', 'winrt']:
37         liboctbstack_env.AppendUnique(CFLAGS = ['-Wall'])
38
39 liboctbstack_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
40 liboctbstack_env.AppendUnique(LIBS = ['coap', 'm'])
41
42 if target_os == 'arduino':
43         liboctbstack_env.AppendUnique(CPPDEFINES = ['NDEBUG', 'WITH_ARDUINO'])
44
45 if target_os in ['darwin', 'ios']:
46         liboctbstack_env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
47
48 if not env.get('RELEASE'):
49         liboctbstack_env.AppendUnique(CPPDEFINES = ['TB_LOG'])
50
51 ######################################################################
52 # Source files and Targets
53 ######################################################################
54 OCTBSTACK_SRC = 'stack/src/'
55 liboctbstack_src = [
56         '../../extlibs/cjson/cJSON.c',
57         '../../extlibs/timer/timer.c',
58         'occoap/src/occoap.c',
59         'occoap/src/occoaphelper.c',
60         OCTBSTACK_SRC + 'ocstack.c',
61         OCTBSTACK_SRC + 'occlientcb.c',
62         OCTBSTACK_SRC + 'ocresource.c',
63         OCTBSTACK_SRC + 'ocobserve.c',
64     OCTBSTACK_SRC + 'ocserverrequest.c',
65         OCTBSTACK_SRC + 'occollection.c',
66         OCTBSTACK_SRC + 'ocsecurity.c',
67     OCTBSTACK_SRC + 'oicgroup.c'
68         ]
69 if target_os == 'arduino':
70         static_liboctbstack = liboctbstack_env.StaticLibrary('octbstack', liboctbstack_src)
71         liboctbstack_env.InstallTarget(static_liboctbstack, 'liboctbstack')
72 else:
73         static_liboctbstack = liboctbstack_env.StaticLibrary('octbstack', liboctbstack_src)
74         shared_liboctbstack = liboctbstack_env.SharedLibrary('octbstack', liboctbstack_src)
75         liboctbstack_env.InstallTarget([static_liboctbstack, shared_liboctbstack], 'liboctbstack')