Merge remote-tracking branch 'origin/master' into notification-service
[platform/upstream/iotivity.git] / service / notification / cpp-wrapper / provider / SConscript
1 #******************************************************************
2 #
3 # Copyright 2016 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 # Notification Service c++ wrapper build script
23 ##
24
25 import platform
26 Import('env')
27
28 if env.get('RELEASE'):
29         env.AppendUnique(CCFLAGS = ['-Os'])
30         env.AppendUnique(CPPDEFINES = ['NDEBUG'])
31 else:
32         env.AppendUnique(CCFLAGS = ['-g'])
33
34 if env.get('LOGGING'):
35         env.AppendUnique(CPPDEFINES = ['TB_LOG'])
36
37 lib_env = env.Clone()
38 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
39 notification_env = lib_env.Clone()
40
41 target_os = env.get('TARGET_OS')
42
43 ######################################################################
44 # Build flags
45 ######################################################################
46 notification_env.AppendUnique(CPPPATH = ['../../include'])
47 notification_env.AppendUnique(CPPPATH = ['inc'])
48 notification_env.AppendUnique(CPPPATH = ['../common'])
49 notification_env.AppendUnique(CPPPATH = ['../consumer/inc'])
50 notification_env.AppendUnique(CPPPATH = ['../../src/common'])
51
52 notification_env.PrependUnique(LIBS = [
53         'oc_logger',
54         'notification_provider'
55         ])
56 notification_env.AppendUnique(CXXFLAGS = ['-O2', '-Wall', '-fmessage-length=0', '-std=c++0x','-frtti'])
57 if target_os == 'android':
58     notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
59     notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
60
61 if env.get('WITH_CLOUD') == True:       
62         notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
63
64 ######################################################################
65 # Source files and Targets
66 ######################################################################
67
68 notification_provider_src = [
69         env.Glob('src/*.cpp'),env.Glob('../common/*.cpp')]
70
71 providersdk = notification_env.SharedLibrary('notification_provider_wrapper', notification_provider_src)
72 notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
73 notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
74
75 providersdk = notification_env.StaticLibrary('notification_provider_wrapper', notification_provider_src)
76 notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
77 notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')