1 #******************************************************************
3 # Copyright 2014 Intel Mobile Communications GmbH 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 # OCLib (share library) build script
26 # Add third party libraries
28 SConscript(env.get('SRC_DIR') + '/resource/third_party_libs.scons', 'lib_env')
30 oclib_env = lib_env.Clone()
31 ######################################################################
33 ######################################################################
34 oclib_env.AppendUnique(CPPPATH = [
36 '../csdk/stack/include',
37 '../csdk/ocrandom/include',
38 '../csdk/logger/include',
39 '../oc_logger/include',
40 '../csdk/connectivity/lib/libcoap-4.1.1'
43 oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
45 oclib_env.AppendUnique(LIBS = ['octbstack', 'oc_logger'])
47 target_os = env.get('TARGET_OS')
48 if target_os == 'linux':
49 oclib_env.AppendUnique(LIBS = ['pthread'])
51 if target_os not in ['windows', 'winrt']:
52 oclib_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC'])
54 if target_os == 'android':
55 oclib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
56 oclib_env.AppendUnique(LIBS = ['boost_thread', 'gnustl_shared', 'log'])
58 ######################################################################
59 # Source files and Targets
60 ######################################################################
63 'OCPlatform_impl.cpp',
67 'OCRepresentation.cpp',
68 'InProcServerWrapper.cpp',
69 'InProcClientWrapper.cpp',
70 'OCResourceRequest.cpp'
73 oclib = oclib_env.SharedLibrary('oc', oclib_src)
74 oclib_env.InstallTarget(oclib, 'liboc')
75 oclib_env.UserInstallTargetLib(oclib, 'liboc')