Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / service / resource-encapsulation / examples / linux / SConscript
1 #******************************************************************
2 #
3 # Copyright 2015 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 (Sample Client & Sample Server)
23 ##
24 Import('env')
25
26 # Add third party libraries
27 lib_env = env.Clone()
28 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
29
30 ResourceClient_env = lib_env.Clone()
31 ResourceServer_env = lib_env.Clone()
32
33 ######################################################################
34 # ##### Resource Client #####
35 ######################################################################
36
37 ResourceClient_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
38 ResourceClient_env.AppendUnique(LIBS = ['rcs_client', 'rcs_common','oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'pthread'])
39 ResourceClient_env.AppendUnique(CPPPATH = ['../../include'])
40 ResourceClient_env.AppendUnique(CPPPATH = ['../../src/resourceBroker/include'])
41 ResourceClient_env.AppendUnique(CPPPATH = ['../../src/resourceCache/include'])
42 ResourceClient_env.AppendUnique(CPPPATH = ['../../src/common/primitiveResource/include'])
43
44 ######################################################################
45 # ##### Resource Server #####
46 ######################################################################
47
48 ResourceServer_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
49 ResourceServer_env.AppendUnique(LIBS = ['rcs_server', 'rcs_common','oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'coap', 'pthread'])
50 ResourceServer_env.AppendUnique(CPPPATH = ['../../include'])
51 ResourceServer_env.AppendUnique(CPPPATH = ['../../src/common/primitiveResource/include'])
52 ResourceServer_env.AppendUnique(CPPPATH = ['../../src/serverBuilder/include'])
53
54 if env.get('SECURED') == '1':
55     ResourceClient_env.AppendUnique(LIBS = ['tinydtls'])
56     ResourceServer_env.AppendUnique(LIBS = ['tinydtls'])
57         
58 if 'rt' in ResourceClient_env.get('LIBS'):
59     ResourceClient_env.Append(LIBS = ['rt'])
60 if 'rt' in ResourceServer_env.get('LIBS'):
61     ResourceServer_env.Append(LIBS = ['rt'])
62
63 ####################################################################
64 # Source files and Targets
65 ####################################################################
66 sampleResourceClient = ResourceClient_env.Program('sampleResourceClient', 'SampleResourceClient.cpp')
67 sampleResourceServer = ResourceServer_env.Program('sampleResourceServer', 'SampleResourceServer.cpp')
68
69 ResourceClient_env.InstallTarget(sampleResourceClient, 'sampleResourceClient')
70 ResourceServer_env.InstallTarget(sampleResourceServer, 'sampleResourceServer')