8f13c5ea0eb53b9915ac1896bd6a1210c90cbba3
[platform/upstream/iotivity.git] / service / resource-manipulation / 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 # basis build script
23 ##
24 import platform
25
26 Import('env')
27
28 SConscript('modules/common/SConscript')
29 #SConscript('modules/resourceBroker/SConscript')
30 #SConscript('modules/resourceCache/SConscript')
31 SConscript('modules/serverBuilder/SConscript')
32 SConscript('modules/resourceContainer/SConscript')
33 #SConscript('sdk/SConscript')
34
35 ######################################################################
36 #building Resource client
37 ######################################################################
38
39 if env.get('RELEASE'):
40         env.AppendUnique(CCFLAGS = ['-Os'])
41         env.AppendUnique(CPPDEFINES = ['NDEBUG'])
42 else:
43         env.AppendUnique(CCFLAGS = ['-g'])
44
45 if env.get('LOGGING'):
46         env.AppendUnique(CPPDEFINES = ['TB_LOG'])
47
48 # Add third party libraries
49 lib_env = env.Clone()
50 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
51
52 resourceClient_env = lib_env.Clone()
53 target_os = env.get('TARGET_OS')
54 ######################################################################
55 # Build flags
56 ######################################################################
57 resourceClient_env.AppendUnique(CPPPATH = ['include'])
58 resourceClient_env.AppendUnique(CPPPATH = ['modules/common/primitiveResource/include'])
59 resourceClient_env.AppendUnique(CPPPATH = ['modules/common/expiryTimer/include'])
60 resourceClient_env.AppendUnique(CPPPATH = ['modules/resourceBroker/include'])
61 resourceClient_env.AppendUnique(CPPPATH = ['modules/resourceCache/include'])
62
63
64 resourceClient_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
65
66 resourceClient_env.PrependUnique(LIBS = ['oc', 'ResourceBroker' , 'ResourceCache', 'service_common', 'octbstack', 'gnustl_shared','oc_logger', 'compatibility', 'log'])
67
68
69 if target_os not in ['windows', 'winrt']:
70     resourceClient_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
71 if target_os == 'linux':
72    resourceClient_env.AppendUnique(LIBS = ['pthread'])
73
74 ######################################################################
75 # Source files and Targets
76 ######################################################################
77 resourceClient_src = 'src/'
78 client_src = [
79         resourceClient_src+ 'ResourceClient.cpp']
80 ResourceClientsdk = resourceClient_env.StaticLibrary('ResourceClient', client_src)
81
82 resourceClient_env.InstallTarget(ResourceClientsdk , 'libResourceClient')
83
84 #Go to build sample apps
85 SConscript('examples/SConscript')
86
87
88
89