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 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #sample-app build script
26 # Add third party libraries
28 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
30 sample_env = lib_env.Clone()
32 target_os = env.get('TARGET_OS')
33 ######################################################################
35 ######################################################################
36 sample_env.AppendUnique(CPPPATH = [
37 '../../plugin-manager/src/',
38 '../../lib/cpluff/libcpluff/',
39 env.get('SRC_DIR') + '/extlibs/rapidxml/'])
40 if target_os not in ['windows', 'winrt']:
41 sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-pthread', '-std=c++0x'])
43 sample_env.AppendUnique(LIBS = ['pthread'])
44 sample_env.AppendUnique(LIBS = ['oc', 'oc_logger', 'octbstack',
45 'connectivity_abstraction', 'coap',
46 'ppm', 'pmimpl', 'dl'])
48 if env.get('SECURED') == '1':
49 sample_env.AppendUnique(LIBS = ['tinydtls'])
51 sample_env.ParseConfig('pkg-config --libs glib-2.0')
53 # On some platforms link order can miss functions so librt needs to be
54 # re-scanned at the end if present. gcc 4.6 is one with this issue.
55 if 'rt' in sample_env.get('LIBS'):
56 sample_env.Append(LIBS = ['rt'])
58 ######################################################################
59 # Source files and Targets
60 ######################################################################
61 mqttclient = sample_env.Program('mqtt/mqttclient', 'mqtt/mqttclient.cpp')
63 Alias('mqttclient', mqttclient)
64 env.AppendTarget('mqttclient')