SceneManager init Code
[platform/upstream/iotivity.git] / service / scene-manager / SConscript
1 #******************************************************************
2 #
3 # Copyright 2015 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 # NotificationManager build script
23 ##
24
25 Import('env')
26
27 if env.get('RELEASE'):
28     env.AppendUnique(CCFLAGS = ['-Os'])
29     env.AppendUnique(CPPDEFINES = ['NDEBUG'])
30 else:
31     env.AppendUnique(CCFLAGS = ['-g'])
32
33 if env.get('LOGGING'):
34     env.AppendUnique(CPPDEFINES = ['TB_LOG'])
35
36 lib_env = env.Clone()
37 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
38 scenemanager_env = lib_env.Clone()
39
40 target_os = env.get('TARGET_OS')
41 ######################################################################
42 # Build flags
43 ######################################################################
44 scenemanager_env.AppendUnique(CPPPATH = ['./include'])
45 scenemanager_env.AppendUnique(CPPPATH = ['./src'])
46 scenemanager_env.AppendUnique(CPPPATH = ['../resource-encapsulation/include'])
47 scenemanager_env.AppendUnique(CPPPATH = ['../resource-encapsulation/src/common/primitiveResource/include'])
48 scenemanager_env.AppendUnique(CPPPATH = ['../resource-encapsulation/src/common/expiryTimer/include'])
49
50 scenemanager_env.PrependUnique(LIBS = [
51     'rcs_client',
52     'rcs_server',
53     'rcs_common',
54     'oc',
55     'octbstack',
56     'oc_logger',
57     'connectivity_abstraction',
58     'libcoap'
59     ])
60
61 if target_os not in ['windows', 'winrt']:
62     scenemanager_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
63
64 if target_os not in ['darwin', 'ios', 'windows', 'winrt']:
65     scenemanager_env.AppendUnique(LINKFLAGS = ['-Wl,--no-undefined'])
66
67 if target_os == 'linux':
68     scenemanager_env.AppendUnique(LIBS = ['pthread'])
69
70 if target_os == 'android':
71     scenemanager_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
72     scenemanager_env.AppendUnique(LIBS = ['gnustl_shared','log'])
73
74     if not env.get('RELEASE'):
75         scenemanager_env.AppendUnique(LIBS = ['log'])
76
77 ######################################################################
78 # Source files and Targets
79 ######################################################################
80 SCENE_SRC_DIR = './src/' 
81 scenemanager_src = [
82         SCENE_SRC_DIR + 'SceneCollection.cpp',
83         SCENE_SRC_DIR + 'SceneMemberObject.cpp',
84         SCENE_SRC_DIR + 'SceneAction.cpp',
85         SCENE_SRC_DIR + 'Scene.cpp',
86         SCENE_SRC_DIR + 'SceneList.cpp'
87         ]
88
89 if target_os in ['tizen','android'] :
90     scenemanagersdk = scenemanager_env.SharedLibrary('scene_manager', scenemanager_src)
91 else :
92     scenemanagersdk = scenemanager_env.StaticLibrary('scene_manager', scenemanager_src)
93
94 scenemanager_env.InstallTarget(scenemanagersdk, 'libscene_manager')
95 scenemanager_env.UserInstallTargetLib(scenemanagersdk, 'libscene_manager')
96 scenemanager_env.UserInstallTargetHeader('include/SceneList.h',\
97     'service/scene-manager', 'SceneList.h')
98
99 # Go to build Unit test
100 #if target_os == 'linux':
101 #    SConscript('src/unittest/SConscript')
102
103 # Go to build sample apps
104 SConscript('sampleapp/SConscript')