Imported Upstream version 1.0.0
[platform/upstream/iotivity.git] / resource / oc_logger / SConscript
1 #******************************************************************
2 #
3 # Copyright 2014 Intel Mobile Communications GmbH 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 # liboc_logger (share library) build script
23 ##
24
25 Import('env')
26
27 lib_env = env.Clone()
28 SConscript(env.get('SRC_DIR') + '/resource/third_party_libs.scons', 'lib_env')
29
30 liboc_logger_env = lib_env.Clone()
31 ######################################################################
32 # Build flags
33 ######################################################################
34 liboc_logger_env.PrependUnique(CPPPATH = ['include'])
35
36 target_os = env.get('TARGET_OS')
37 if target_os == 'android':
38         liboc_logger_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
39         liboc_logger_env.AppendUnique(LIBS = ['gnustl_shared', 'log'])
40
41 if target_os not in ['arduino', 'windows', 'winrt']:
42         liboc_logger_env.AppendUnique(CFLAGS = ['-Wall', '-std=c99', '-fPIC'])
43         liboc_logger_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x', '-fPIC'])
44
45 if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
46         liboc_logger_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
47
48 ######################################################################
49 # Source files and Targets
50 ######################################################################
51 liboc_logger_core = liboc_logger_env.SharedLibrary('oc_logger_core', 'c/oc_logger.c',  OBJPREFIX='core_')
52 liboc_logger = liboc_logger_env.SharedLibrary('oc_logger',
53                 ['c/oc_logger.c', 'c/oc_console_logger.c', 'cpp/oc_ostream_logger.cpp'])
54
55 liboc_logger_env.InstallTarget([liboc_logger_core, liboc_logger], 'liboc_logger')
56 liboc_logger_env.UserInstallTargetLib([liboc_logger_core, liboc_logger], 'liboc_logger')
57
58 if target_os not in ['ios', 'android']:
59         SConscript('examples/SConscript')
60