5b7461c736017059d32b069e68b0ce198f1d04c6
[platform/upstream/iotivity.git] / service / protocol-plugin / plugin-manager / 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 # plugin-manager project 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 plugin_manager_env = lib_env.Clone()
31
32 target_os = env.get('TARGET_OS')
33 ######################################################################
34 # Build flags
35 ######################################################################
36 plugin_manager_env.AppendUnique(CPPPATH = [
37                 '../lib/cpluff/libcpluff',
38                 'src',
39                 '../lib/rapidxml'
40                 ])
41
42 if target_os not in ['windows', 'winrt']:
43         plugin_manager_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall',
44                 '-fpermissive', '-Wsign-compare'])
45
46 if target_os == 'android':
47         plugin_manager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
48         plugin_manager_env.AppendUnique(LIBS = ['boost_thread-gcc-mt-1_49', 'gnustl_static'])
49
50 plugin_manager_env.AppendUnique(CPPDEFINES = ['CP_C_API=CP_EXPORT',
51                                         'CP_HOST=\"\\"'+env.get('TARGET_OS')+'\\"\"',
52                                         'CP_DATADIR=\"\\\"/usr/local/share\\\"\"',
53                                         'DLOPEN_POSIX',
54                                         'DPIC',
55                                         'CP_THREADS=\"\\\"Posix\\"\"',
56                                         'CP_SHREXT=\"\\".so\\"\"',
57                                         'CP_FNAMESEP_CHAR=\"\'/\'\"',
58                                         'CP_FNAMESEP_STR=\"\\\"/\\"\"',
59                                         'PACKAGE=\"\\\"cpluff\\\"\"'])
60
61
62 plugin_manager_env.AppendUnique(LIBS = ['oc', 'octbstack', 'expat', 'dl'])
63 ######################################################################
64 # Source files and Targets
65 ######################################################################
66 ppm_src = ['src/Plugin.cpp', 'src/PluginManager.cpp']
67 ppm = plugin_manager_env.StaticLibrary('ppm', ppm_src)
68
69 pmimpl_src = [
70                 'src/CpluffAdapter.cpp',
71                 'src/FelixAdapter.cpp',
72                 'src/Plugin.cpp',
73                 'src/PluginManagerImpl.cpp',
74                 'src/Config.cpp']
75
76 pmimpl_env = plugin_manager_env.Clone()
77 pmimpl_env.PrependUnique(CCFLAGS = ['-fPIC'])
78 pmimpl_env.PrependUnique(LIBS = File(env.get('BUILD_DIR') + '/libcpluff.a'))
79 pmimpl = pmimpl_env.SharedLibrary('pmimpl', pmimpl_src)
80
81 plugin_manager_env.InstallTarget([ppm, pmimpl], 'libppm')
82