1 #******************************************************************
3 # Copyright 2014 Intel Mobile Communications GmbH 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 # liboc_logger (share library) build script
28 SConscript(env.get('SRC_DIR') + '/resource/third_party_libs.scons', 'lib_env')
30 liboc_logger_env = lib_env.Clone()
31 ######################################################################
33 ######################################################################
34 liboc_logger_env.PrependUnique(CPPPATH = ['include'])
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 liboc_logger_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,liboc_logger.so'])
42 if target_os not in ['arduino', 'windows', 'winrt']:
43 liboc_logger_env.AppendUnique(CFLAGS = ['-Wall', '-std=c99', '-fPIC'])
44 liboc_logger_env.AppendUnique(CXXFLAGS = ['-Wall', '-std=c++0x', '-fPIC'])
46 if target_os not in ['darwin', 'ios', 'windows', 'winrt', 'msys_nt']:
47 liboc_logger_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
49 ######################################################################
50 # Source files and Targets
51 ######################################################################
55 if target_os in ['windows', 'msys_nt']:
56 # TODO: Add OC_EXPORT API prefixes to enable oc_logger DLL generation.
57 oc_logger_libs += liboc_logger_env.StaticLibrary('oc_logger',
58 ['c/oc_logger.c', 'c/oc_console_logger.c', 'cpp/oc_ostream_logger.cpp'])
60 oc_logger_libs += Flatten(liboc_logger_env.SharedLibrary('oc_logger_core',
61 ['c/oc_logger.c'], OBJPREFIX='core_'))
62 oc_logger_libs += Flatten(liboc_logger_env.SharedLibrary('oc_logger',
63 ['c/oc_logger.c', 'c/oc_console_logger.c', 'cpp/oc_ostream_logger.cpp']))
65 liboc_logger_env.InstallTarget(oc_logger_libs, 'oc_logger')
66 liboc_logger_env.UserInstallTargetLib(oc_logger_libs, 'oc_logger')
67 liboc_logger_env.UserInstallTargetHeader('include/oc_logger.hpp', 'resource', 'oc_logger.hpp')
68 liboc_logger_env.UserInstallTargetHeader('include/oc_logger.h', 'resource', 'oc_logger.h')
69 liboc_logger_env.UserInstallTargetHeader('include/oc_logger_types.h', 'resource', 'oc_logger_types.h')
70 liboc_logger_env.UserInstallTargetHeader('include/oc_log_stream.hpp', 'resource', 'oc_log_stream.hpp')
71 liboc_logger_env.UserInstallTargetHeader('include/targets/oc_console_logger.h', 'resource/targets', 'oc_console_logger.h')
72 liboc_logger_env.UserInstallTargetHeader('include/targets/oc_ostream_logger.h', 'resource/targets', 'oc_ostream_logger.h')
74 if target_os not in ['ios', 'android']:
75 SConscript('examples/SConscript')