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 # Plugins build script
26 # Add third party libraries
28 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
30 plugins_env = lib_env.Clone()
32 target_os = env.get('TARGET_OS')
33 ######################################################################
35 ######################################################################
36 plugins_env.AppendUnique(CPPPATH = ['../lib/cpluff/libcpluff'])
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'])
43 #plugins_env.AppendUnique(LIBS=['libconnectivity-abstraction'])
45 if target_os not in ['arduino', 'android']:
46 plugins_env.AppendUnique(LIBS = ['pthread'])
48 if target_os == 'android':
49 plugins_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
50 plugins_env.AppendUnique(LIBS = ['gnustl_shared'])
52 plugins_env.AppendUnique(LIBS = [File(env.get('BUILD_DIR') + '/libmosquitto.a'),
53 'mosquitto', 'ssl', 'rt'])
56 ######################################################################
57 # Source files and Targets
58 ######################################################################
59 plugins_env['LIBPREFIX'] = ''
61 mqtt_fan_src = Glob('mqtt-fan/src/' + '*.cpp')
62 fanserver = plugins_env.SharedLibrary('mqtt-fan/fanserver_mqtt_plugin', mqtt_fan_src)
64 mqtt_light_src = Glob('mqtt-light/src/' + '*.cpp')
65 lightserver = plugins_env.SharedLibrary('mqtt-light/lightserver_mqtt_plugin', mqtt_light_src)
67 SConscript('mqtt-fan/lib/SConscript')