ca33f9535b09024c1fb0bdc9607c128e420f0f00
[platform/upstream/iotivity.git] / service / resource-container / examples / BMISensorBundle / src / inputSensors / WeightSensorApp / SConscript
1 ##
2 # linux sample app  build script
3 ##
4
5 Import('env')
6
7 # Add third party libraries
8 lib_env = env.Clone()
9 SConscript('#service/third_party_libs.scons', 'lib_env')
10 linux_sample_env = lib_env.Clone()
11
12 ######################################################################
13 # Build flags
14 ######################################################################
15 linux_sample_env.AppendUnique(CPPPATH = ['include'])
16 linux_sample_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall', '-pthread'])
17 linux_sample_env.AppendUnique(CPPDEFINES = ['LINUX'])
18 linux_sample_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
19 linux_sample_env.AppendUnique(LIBS = ['coap'])
20 linux_sample_env.AppendUnique(LIBS = ['connectivity_abstraction'])
21 linux_sample_env.AppendUnique(LIBS = ['oc_logger'])
22 linux_sample_env.AppendUnique(LIBS = ['octbstack'])
23 linux_sample_env.AppendUnique(LIBS = ['oc'])
24 linux_sample_env.AppendUnique(LIBS = ['pthread'])
25
26 if env.get('SECURED') == '1':
27     linux_sample_env.AppendUnique(LIBS = ['tinydtls'])
28     if env.get('WITH_TCP') == True:
29         linux_sample_env.AppendUnique(LIBS = ['mbedtls', 'mbedx509', 'mbedcrypto'])
30
31 # On some platforms link order can miss functions so librt needs to be
32 # re-scanned at the end if present. gcc 4.6 is one with this issue.
33 if 'rt' in linux_sample_env.get('LIBS'):
34     linux_sample_env.Append(LIBS = ['rt'])
35
36 ######################################################################
37 #build sampleapp
38 ######################################################################
39 weightsensorapp = linux_sample_env.Program('WeightSensorApp', 'src/WeightSensorApp.cpp')
40 Alias("weightsensorapp_sample", weightsensorapp)
41 env.AppendTarget('weightsensorapp')