2 # Examples build script
5 # Add third party libraries
7 SConscript(env.get('SRC_DIR') + '/resource/third_party_libs.scons', 'lib_env')
9 ocicuc_env = lib_env.Clone()
10 ######################################################################
12 ######################################################################
13 ocicuc_env.AppendUnique(CPPPATH = [
15 '../../csdk/stack/include',
16 '../../csdk/ocsocket/include',
17 '../../csdk/ocrandom/include',
18 '../../csdk/logger/include',
19 '../../oc_logger/include'
22 ocicuc_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
23 ocicuc_env.PrependUnique(LIBS = ['oc', 'octbstack', 'coap', 'oc_logger'])
25 target_os = env.get('TARGET_OS')
26 if target_os not in ['windows', 'winrt']:
27 ocicuc_env.AppendUnique(CXXFLAGS = ['-std=c++0x'])
29 if target_os == 'android':
30 ocicuc_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
31 ocicuc_env.AppendUnique(CPPDEFINES = ['_GLIBCXX_USE_C99=1', '_GLIBCXX_HAVE_WCSTOF=1'])
32 ocicuc_env.AppendUnique(LIBS = ['boost_program_options-gcc-mt-1_49', 'boost_thread-gcc-mt-1_49', 'gnustl_static'])
34 if not env.get('RELEASE'):
35 ocicuc_env.AppendUnique(LIBS = ['log'])
37 if target_os == 'darwin':
38 ocicuc_env.AppendUnique(LIBS = ['boost_program_options'])
40 ######################################################################
41 # Source files and Targets
42 ######################################################################
43 client = ocicuc_env.Program('client', ['client.cpp', 'driver.cpp', 'utility.cpp'])
44 server = ocicuc_env.Program('server', ['server.cpp', 'driver.cpp', 'utility.cpp', 'light_resource.cpp'])
45 monoprocess = ocicuc_env.Program('monoprocess', ['monoprocess.cpp', 'driver.cpp', 'utility.cpp', 'light_resource.cpp'])
46 small_example = ocicuc_env.Program('small_example', ['small_example.cpp', 'driver.cpp', 'utility.cpp'])
48 Alias("examples_ocicuc", [client, server, monoprocess, small_example])
49 env.AppendTarget('examples_ocicuc')