Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / service / things-manager / sampleapp / linux / configuration / SConscript
1 #******************************************************************
2 #
3 # Copyright 2014 Samsung Electronics All Rights Reserved.
4 #
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #
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
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 ##
22 # linux sample app  build script
23 ##
24
25 Import('env')
26
27 # Add third party libraries
28 lib_env = env.Clone()
29 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
30 linux_sample_env = lib_env.Clone()
31
32 ######################################################################
33 # Build flags
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', '-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'])
47
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'])
52
53 ######################################################################
54 #build sampleapp
55 ######################################################################
56 conserver = linux_sample_env.Program('con-server', ['ConfigurationCollection.cpp', 'DiagnosticsCollection.cpp', 'FactorySetCollection.cpp', 'con-server.cpp'])
57 conclient = linux_sample_env.Program('con-client', 'con-client.cpp')
58 bootstrapserver = linux_sample_env.Program('bootstrapserver', 'bootstrapserver.cpp')
59 Alias("ConServerApp", conserver)
60 Alias("ConClientApp", conclient)
61 Alias("BootstrapServerApp", bootstrapserver)
62 env.AppendTarget('ConServerApp')
63 env.AppendTarget('ConClientApp')
64 env.AppendTarget('BootstrapServerApp')