1 #******************************************************************
3 # Copyright 2014 Samsung Electronics 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 # Simulator build script
29 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', 'lib_env')
30 simulator_env = lib_env.Clone()
32 target_os = env.get('TARGET_OS')
33 ######################################################################
35 ######################################################################
36 simulator_env.AppendUnique(CPPPATH = ['inc', 'src'])
37 simulator_env.AppendUnique(CPPPATH = [
38 '../../resource/include/',
39 '../../resource/csdk/stack/include',
40 '../../resource/csdk/ocrandom/include',
41 '../../resource/csdk/logger/include',
42 '../../resource/oc_logger/include',
45 # Including Java path for building JNI files
47 os.environ['JAVA_HOME']
50 *************************************** Error *********************************
51 * JAVA_HOME environment variable not set
52 * Simulator has dependency on java, Please set environment variable JAVA_HOME
53 *******************************************************************************
57 java_headers = [os.path.join(os.environ['JAVA_HOME'], 'include')]
58 java_headers.append(os.path.join(java_headers[0], 'win32'))
59 java_headers.append(os.path.join(java_headers[0], 'linux'))
60 java_headers.append(os.path.join(java_headers[0], 'solaris'))
61 simulator_env.AppendUnique(CPPPATH = java_headers)
63 simulator_env.AppendUnique(CPPPATH = ['../../extlibs/cjson'])
64 simulator_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'libcoap'])
65 simulator_env.AppendUnique(LIBS = ['pthread'])
67 simulator_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
69 ######################################################################
70 # Source files and Targets
71 ######################################################################
72 simulator_src = [env.Glob('src/*.cpp'), env.Glob('java/jni/*.cpp')]
73 simulatorsdk = simulator_env.SharedLibrary('SimulatorManager', simulator_src)
75 simulator_env.InstallTarget(simulatorsdk, 'libSimulator')
77 #Build sample application
78 SConscript('examples/server/SConscript')