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
25 # Add third party libraries
27 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
29 sample_env = lib_env.Clone()
30 target_os = env.get('TARGET_OS')
31 ######################################################################
33 ######################################################################
34 sample_env.AppendUnique(CPPPATH = [
35 '../../plugin-manager/src/',
36 '../../lib/cpluff/libcpluff/',
37 env.get('SRC_DIR') + '/extlibs/rapidxml/'])
39 if target_os not in ['windows', 'winrt']:
40 sample_env.AppendUnique(CXXFLAGS = ['-Wall', '-pthread', '-std=c++0x'])
42 sample_env.AppendUnique(LIBS = ['oc', 'oc_logger', 'octbstack',
43 'connectivity_abstraction', 'coap',
44 'ppm', 'pmimpl', 'dl'])
46 if env.get('SECURED') == '1':
47 sample_env.AppendUnique(LIBS = ['tinydtls'])
49 # On some platforms link order can miss functions so librt needs to be
50 # re-scanned at the end if present. gcc 4.6 is one with this issue.
51 if 'rt' in sample_env.get('LIBS'):
52 sample_env.Append(LIBS = ['rt'])
54 sample_env.AppendUnique(LIBS = ['pthread'])
55 ######################################################################
56 # Source files and Targets
57 ######################################################################
58 mqttclient = sample_env.Program('mqtt/mqttclient', 'mqtt/mqttclient.cpp')
60 Command("mqtt/pluginmanager.xml","../../plugin-manager/src/pluginmanager.xml", Copy("$TARGET", "$SOURCE"))
61 Command("mqtt/libpmimpl.so","../../../../libpmimpl.so", Copy("$TARGET", "$SOURCE"))
63 Alias('mqttclient', mqttclient)
64 env.AppendTarget('mqttclient')