Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / service / protocol-plugin / plugins / 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 # Plugins build script
22 ##
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 plugins_env = lib_env.Clone()
31
32 target_os = env.get('TARGET_OS')
33 ######################################################################
34 # Build flags
35 ######################################################################
36 plugins_env.AppendUnique(CPPPATH = ['../lib/cpluff/libcpluff'])
37
38 if target_os not in ['windows', 'winrt']:
39     plugins_env.AppendUnique(CXXFLAGS = ['-g3', '-Wall', '-pthread', '-std=c++0x'])
40     plugins_env.PrependUnique(CCFLAGS = ['-fPIC'])
41     plugins_env.AppendUnique(LINKFLAGS = ['-fPIC'])
42
43 #plugins_env.AppendUnique(LIBS=['libconnectivity-abstraction'])
44
45     if target_os not in ['arduino', 'android']:
46         plugins_env.AppendUnique(LIBS = ['pthread'])
47
48 if target_os == 'android':
49     plugins_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
50     plugins_env.AppendUnique(LIBS = ['gnustl_shared'])
51
52 plugins_env.AppendUnique(LIBS = [File(env.get('BUILD_DIR') + '/libmosquitto.a'),
53         'mosquitto', 'ssl', 'rt'])
54
55
56 ######################################################################
57 # Source files and Targets
58 ######################################################################
59 plugins_env['LIBPREFIX'] = ''
60
61 mqtt_fan_src = Glob('mqtt-fan/src/' + '*.cpp')
62 fanserver = plugins_env.SharedLibrary('mqtt-fan/fanserver_mqtt_plugin', mqtt_fan_src)
63
64 mqtt_light_src = Glob('mqtt-light/src/' + '*.cpp')
65 lightserver = plugins_env.SharedLibrary('mqtt-light/lightserver_mqtt_plugin', mqtt_light_src)
66
67 SConscript('mqtt-fan/lib/SConscript')