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/ocsocket/include',
18 '../csdk/ocrandom/include',
19 '../csdk/logger/include',
21 '../oc_logger/include'
24 target_os = env.get('TARGET_OS')
25 if target_os not in ['windows', 'winrt']:
26 oclib_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-fPIC'])
28 if target_os == 'android':
29 oclib_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
30 oclib_env.AppendUnique(CPPDEFINES = ['_GLIBCXX_USE_C99=1', '_GLIBCXX_HAVE_WCSTOF=1'])
31 oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
32 oclib_env.AppendUnique(LIBS = ['octbstack', 'coap', 'oc_logger', 'boost_thread-gcc-mt-1_49', 'gnustl_static', 'log'])
34 if target_os in ['darwin', 'ios']:
35 oclib_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
36 oclib_env.AppendUnique(LIBS = ['octbstack', 'coap', 'oc_logger'])
38 ######################################################################
39 # Source files and Targets
40 ######################################################################
43 'OCPlatform_impl.cpp',
47 'OCRepresentation.cpp',
48 'InProcServerWrapper.cpp',
49 'InProcClientWrapper.cpp'
52 oclib = oclib_env.SharedLibrary('oc', oclib_src)
53 oclib_env.InstallTarget(oclib, 'liboc')