2 # OCLib (share library) build script
6 # Add third party libraries
8 SConscript(env.get('SRC_DIR') + '/resource/third_party_libs.scons', 'lib_env')
10 oclib_env = lib_env.Clone()
11 ######################################################################
13 ######################################################################
14 oclib_env.AppendUnique(CPPPATH = [
16 '../csdk/stack/include',
17 '../csdk/ocrandom/include',
18 '../csdk/logger/include',
19 '../oc_logger/include',
20 '../csdk/connectivity/lib/libcoap-4.1.1'
23 target_os = env.get('TARGET_OS')
24 if target_os not in ['windows', 'winrt']:
25 oclib_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC'])
27 if target_os == 'android':
28 oclib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
29 oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
30 oclib_env.AppendUnique(LIBS = ['octbstack', 'oc_logger', 'boost_thread-gcc-mt-1_49', 'gnustl_static', 'log'])
32 if target_os in ['darwin', 'ios']:
33 oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
34 oclib_env.AppendUnique(LIBS = ['octbstack', 'oc_logger'])
36 ######################################################################
37 # Source files and Targets
38 ######################################################################
41 'OCPlatform_impl.cpp',
45 'OCRepresentation.cpp',
46 'InProcServerWrapper.cpp',
47 'InProcClientWrapper.cpp',
48 'OCResourceRequest.cpp'
51 oclib_env.AppendUnique(CPPPATH = [oclib_env.get('SRC_DIR') + '/extlibs/cereal/include'])
52 oclib = oclib_env.SharedLibrary('oc', oclib_src)
53 oclib_env.InstallTarget(oclib, 'liboc')