1 #******************************************************************
3 # Copyright 2016 Samsung Electronics 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 # Notification Service c++ wrapper build script
28 if env.get('RELEASE'):
29 env.AppendUnique(CCFLAGS = ['-Os'])
30 env.AppendUnique(CPPDEFINES = ['NDEBUG'])
32 env.AppendUnique(CCFLAGS = ['-g'])
34 if env.get('LOGGING'):
35 env.AppendUnique(CPPDEFINES = ['TB_LOG'])
38 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
39 notification_env = lib_env.Clone()
41 target_os = env.get('TARGET_OS')
43 ######################################################################
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'])
52 notification_env.PrependUnique(LIBS = [
56 'notification_provider'
58 notification_env.AppendUnique(CXXFLAGS = ['-std=c++0x','-frtti'])
60 if target_os not in ['windows', 'winrt']:
61 notification_env.AppendUnique(CCFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
63 if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
64 notification_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
66 if target_os == 'linux':
67 notification_env.AppendUnique(LIBS = ['pthread'])
69 if target_os == 'android':
70 notification_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
71 notification_env.PrependUnique(LIBS = ['gnustl_shared', 'log'])
73 if not env.get('RELEASE') and target_os not in ['ios']:
74 notification_env.PrependUnique(LIBS = ['gcov'])
75 notification_env.AppendUnique(CCFLAGS = ['--coverage'])
77 if env.get('WITH_CLOUD') == True:
78 notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
80 ######################################################################
81 # Source files and Targets for Provider
82 ######################################################################
83 notification_jni_provider_env = notification_env.Clone()
85 notificationCommonStaticObjs = [
86 notification_env.Object('../common/NSMediaContents.cpp'),
87 notification_env.Object('../common/NSMessage.cpp'),
88 notification_env.Object('../common/NSSyncInfo.cpp'),
89 notification_env.Object('../common/NSTopic.cpp'),
90 notification_env.Object('../common/NSTopicsList.cpp')]
92 notificationCommonSharedObjs = [
93 notification_env.SharedObject('../common/NSMediaContents.cpp'),
94 notification_env.SharedObject('../common/NSMessage.cpp'),
95 notification_env.SharedObject('../common/NSSyncInfo.cpp'),
96 notification_env.SharedObject('../common/NSTopic.cpp'),
97 notification_env.SharedObject('../common/NSTopicsList.cpp')]
99 notification_provider_src = [
100 env.Glob('src/*.cpp'),notificationCommonSharedObjs]
102 if target_os not in ['ios']:
103 providersdk = notification_env.SharedLibrary('notification_provider_wrapper', notification_provider_src)
104 notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
105 notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
107 notification_provider_src = [
108 env.Glob('src/*.cpp'),notificationCommonStaticObjs]
110 providersdk = notification_env.StaticLibrary('notification_provider_wrapper', notification_provider_src)
111 notification_env.InstallTarget(providersdk, 'libnotification_provider_wrapper')
112 notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider_wrapper')
114 Export('notificationCommonStaticObjs')
115 Export('notificationCommonSharedObjs')
117 ######################################################################
118 # Source files and Targets for Provider Jni
119 ######################################################################
120 if target_os == 'android':
121 notification_jni_provider_env.AppendUnique(CPPPATH = ['../../../../extlibs/boost/boost_1_58_0'])
122 notification_jni_provider_env.AppendUnique(CPPPATH = ['../../../../android/android_api/base/jni'])
123 notification_jni_provider_env.AppendUnique(CPPPATH = ['../../android/notification-service/src/main/jni/common'])
124 notification_jni_provider_env.AppendUnique(CPPPATH = ['../../android/notification-service/src/main/jni/provider'])
126 notification_jni_provider_env.PrependUnique(LIBS = [
127 'notification_provider_wrapper'
130 notificationJniCommonSharedObjs = [
131 notification_jni_provider_env.SharedObject('../../android/notification-service/src/main/jni/common/JniNotificationCommon.cpp')]
133 notification_provider_jni_src = [
134 env.Glob('../../android/notification-service/src/main/jni/provider/*.cpp'),
135 notificationJniCommonSharedObjs]
137 providerJni = notification_jni_provider_env.SharedLibrary('notification_provider_jni', notification_provider_jni_src)
138 notification_jni_provider_env.InstallTarget(providerJni, 'libnotification_provider_jni')
139 notification_jni_provider_env.UserInstallTargetLib(providerJni, 'libnotification_provider_jni')
141 Export('notificationJniCommonSharedObjs')