Imported Upstream version 0.9.1
[platform/upstream/iotivity.git] / resource / oc_logger / examples / 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 examples 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 examples_env = lib_env.Clone()
31 ######################################################################
32 # Build flags
33 ######################################################################
34 examples_env.PrependUnique(CPPPATH = ['../include'])
35 examples_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
36 examples_env.AppendUnique(LIBS = ['oc_logger', 'stdc++'])
37
38 target_os = env.get('TARGET_OS')
39 if target_os == 'android':
40         examples_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
41         examples_env.AppendUnique(LIBS = ['gnustl_shared'])
42
43 if target_os not in ['arduino', 'windows', 'winrt']:
44         examples_env.AppendUnique(CFLAGS = Split('-Wall -std=c99 -Werror'))
45         examples_env.AppendUnique(CXXFLAGS = Split('-Wall -std=c++0x'))
46
47 ######################################################################
48 # Source files and Targets
49 ######################################################################
50 examples_c = examples_env.Program('examples_c', 'test_logging.c', OBJPREFIX='c_')
51 examples_cpp = examples_env.Program('examples_cpp', 'test_logging.cpp')
52
53 Alias('liboc_logger_examples', [examples_c, examples_cpp])
54 examples_env.AppendTarget('liboc_logger_examples')
55