1 #******************************************************************
3 # Copyright 2014 Samsung Electronics All Rights Reserved.
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
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
11 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
22 # linux sample app build script
27 # Add third party libraries
29 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
30 linux_sample_env = lib_env.Clone()
32 ######################################################################
34 ######################################################################
35 linux_sample_env.AppendUnique(CPPPATH = ['include'])
36 linux_sample_env.AppendUnique(CPPPATH = ['../../../../../extlibs/timer'])
37 linux_sample_env.AppendUnique(CPPPATH = ['../../../sdk/inc'])
38 linux_sample_env.AppendUnique(CPPPATH = ['../../../sdk/src'])
39 linux_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-DLINUX', '-pthread'])
40 linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX'])
41 linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
42 linux_sample_env.AppendUnique(LIBS = ['libTGMSDKLibrary', 'oc', 'octbstack',
43 'connectivity_abstraction',
44 'libcoap', 'liboc_logger', 'dl', 'pthread'])
45 if env.get('SECURED') == '1':
46 linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
48 # On some platforms link order can miss functions so librt needs to be
49 # re-scanned at the end if present. gcc 4.6 is one with this issue.
50 if 'rt' in linux_sample_env.get('LIBS'):
51 linux_sample_env.Append(LIBS = ['rt'])
53 ######################################################################
55 ######################################################################
56 groupserver = linux_sample_env.Program('groupserver', 'groupserver.cpp')
57 lightserver = linux_sample_env.Program('lightserver', 'lightserver.cpp')
58 bookmark = linux_sample_env.Program('bookmark', 'bookmark.cpp')
59 Alias("GroupServerApp", groupserver)
60 Alias("LightServerApp", lightserver)
61 Alias("BookmarkApp", bookmark)
62 env.AppendTarget('GroupServerApp')
63 env.AppendTarget('LightServerApp')
64 env.AppendTarget('BookmarkApp')