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/resource-directory/include'])
51 notification_env.AppendUnique(CPPPATH = ['../../resource/csdk/connectivity/api'])
53 notification_env.PrependUnique(LIBS = [
56 'connectivity_abstraction',
61 if target_os not in ['windows', 'winrt']:
62 notification_env.AppendUnique(CCFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0'])
64 if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
65 notification_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
67 if target_os == 'linux':
68 notification_env.AppendUnique(LIBS = ['pthread'])
70 if target_os == 'android':
71 notification_env.AppendUnique(CCFLAGS = ['-frtti', '-fexceptions'])
72 notification_env.AppendUnique(LIBS = ['gnustl_shared','log'])
74 if not env.get('RELEASE'):
75 notification_env.AppendUnique(LIBS = ['log'])
77 if not env.get('RELEASE'):
78 notification_env.PrependUnique(LIBS = ['gcov'])
79 notification_env.AppendUnique(CCFLAGS = ['--coverage'])
81 if 'CLIENT' in notification_env.get('RD_MODE'):
82 notification_env.AppendUnique(CPPDEFINES = ['RD_CLIENT'])
84 if env.get('WITH_CLOUD') == True:
85 notification_env.AppendUnique(CPPDEFINES = ['WITH_CLOUD'])
87 if env.get('SECURED') == '1':
88 notification_env.AppendUnique(CPPDEFINES = ['SECURED'])
90 ######################################################################
91 # Source files and Targets
92 ######################################################################
93 notification_provider_env = notification_env.Clone()
94 notification_consumer_env = notification_env.Clone()
96 if target_os == 'android':
97 notification_provider_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_provider.so'])
98 if target_os == 'android':
99 notification_consumer_env.AppendUnique(LINKFLAGS = ['-Wl,-soname,libnotification_consumer.so'])
101 notification_provider_src = [
102 env.Glob('src/provider/*.c'), env.Glob('src/common/*.c')]
103 notification_consumer_src = [
104 env.Glob('src/consumer/*.c'), env.Glob('src/common/*.c')]
107 providersdk = notification_provider_env.SharedLibrary('notification_provider', notification_provider_src)
108 notification_provider_env.InstallTarget(providersdk, 'libnotification_provider')
109 notification_provider_env.UserInstallTargetLib(providersdk, 'libnotification_provider')
111 consumersdk = notification_consumer_env.SharedLibrary('notification_consumer', notification_consumer_src)
112 notification_consumer_env.InstallTarget(consumersdk, 'libnotification_consumer')
113 notification_consumer_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer')
115 providersdk = notification_provider_env.StaticLibrary('notification_provider', notification_provider_src)
116 notification_provider_env.InstallTarget(providersdk, 'libnotification_provider')
117 notification_provider_env.UserInstallTargetLib(providersdk, 'libnotification_provider')
119 consumersdk = notification_consumer_env.StaticLibrary('notification_consumer', notification_consumer_src)
120 notification_consumer_env.InstallTarget(consumersdk, 'libnotification_consumer')
121 notification_consumer_env.UserInstallTargetLib(consumersdk, 'libnotification_consumer')
123 notification_provider_env.UserInstallTargetHeader('include/NSProviderInterface.h',\
124 'service/notification', 'NSProviderInterface.h')
125 notification_consumer_env.UserInstallTargetHeader('include/NSConsumerInterface.h',\
126 'service/notification', 'NSConsumerInterface.h')
128 # Go to build Unit test
129 if target_os == 'linux':
130 SConscript('unittest/SConscript')
132 # Go to build c++ wrapper
133 SConscript('cpp-wrapper/SConscript')
135 if target_os == 'android':
136 SConscript('android/SConscript')
138 # Go to build sample apps
139 SConscript('examples/SConscript')