1 #******************************************************************
3 # Copyright 2015 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 (Sample Client & Sample Server)
26 # Add third party libraries
28 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
30 ResourceClient_env = lib_env.Clone()
31 ResourceServer_env = lib_env.Clone()
33 ######################################################################
34 # ##### Resource Client #####
35 ######################################################################
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'])
44 ######################################################################
45 # ##### Resource Server #####
46 ######################################################################
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'])
54 if env.get('SECURED') == '1':
55 ResourceClient_env.AppendUnique(LIBS = ['tinydtls'])
56 ResourceServer_env.AppendUnique(LIBS = ['tinydtls'])
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'])
63 ####################################################################
64 # Source files and Targets
65 ####################################################################
66 sampleResourceClient = ResourceClient_env.Program('sampleResourceClient', 'SampleResourceClient.cpp')
67 sampleResourceServer = ResourceServer_env.Program('sampleResourceServer', 'SampleResourceServer.cpp')
69 ResourceClient_env.InstallTarget(sampleResourceClient, 'sampleResourceClient')
70 ResourceServer_env.InstallTarget(sampleResourceServer, 'sampleResourceServer')