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 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')
42 ######################################################################
44 ######################################################################
45 notification_env.AppendUnique(CPPPATH = ['include'])
46 notification_env.AppendUnique(CPPPATH = ['src/common'])
47 notification_env.AppendUnique(CPPPATH = ['src/provider'])
48 notification_env.AppendUnique(CPPPATH = ['src/consumer'])
49 notification_env.AppendUnique(CPPPATH = ['../../resource/csdk/stack/include'])
50 notification_env.AppendUnique(CPPPATH = ['../../resource/csdk/connectivity/api'])
52 notification_env.PrependUnique(LIBS = [
55 'connectivity_abstraction',
59 if target_os not in ['windows', 'winrt']:
60 notification_env.AppendUnique(CCFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
62 if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
63 notification_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
65 if target_os == 'linux':
66 notification_env.AppendUnique(LIBS = ['pthread'])
68 if target_os == 'android':
69 notification_env.AppendUnique(CCFLAGS = ['-frtti', '-fexceptions'])
70 notification_env.AppendUnique(LIBS = ['gnustl_shared','log'])
71 notification_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_provider.so'])
73 if not env.get('RELEASE'):
74 notification_env.AppendUnique(LIBS = ['log'])
76 if not env.get('RELEASE'):
77 notification_env.PrependUnique(LIBS = ['gcov'])
78 notification_env.AppendUnique(CCFLAGS = ['--coverage'])
80 if env.get('WITH_CLOUD') == True:
81 notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
83 ######################################################################
84 # Source files and Targets
85 ######################################################################
87 notification_provider_src = [
88 env.Glob('src/provider/*.c'), env.Glob('src/common/*.c')]
89 notification_consumer_src = [
90 env.Glob('src/consumer/*.c'), env.Glob('src/common/*.c')]
92 providersdk = notification_env.SharedLibrary('notification_provider', notification_provider_src)
93 notification_env.InstallTarget(providersdk, 'libnotification_provider')
94 notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider')
96 consumersdk = notification_env.SharedLibrary('notification_consumer', notification_consumer_src)
97 notification_env.InstallTarget(consumersdk, 'libnotification_consumer')
98 notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer')
100 providersdk = notification_env.StaticLibrary('notification_provider', notification_provider_src)
101 notification_env.InstallTarget(providersdk, 'libnotification_provider')
102 notification_env.UserInstallTargetLib(providersdk, 'libnotification_provider')
104 consumersdk = notification_env.StaticLibrary('notification_consumer', notification_consumer_src)
105 notification_env.InstallTarget(consumersdk, 'libnotification_consumer')
106 notification_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer')
108 notification_env.UserInstallTargetHeader('include/NSProviderInterface.h',\
109 'service/notification', 'NSProviderInterface.h')
110 notification_env.UserInstallTargetHeader('include/NSConsumerInterface.h',\
111 'service/notification', 'NSConsumerInterface.h')
113 # Go to build Unit test
114 #if target_os == 'linux':
115 #SConscript('unittest/SConscript')
117 # Go to build sample apps
118 SConscript('examples/SConscript')
121 #if target_os == 'android':
122 # SConscript('android/SConscript')
124 # Go to build c++ wrapper
125 #SConscript('cpp-wrapper/SConscript')