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',
44 './ramlparser/raml/model',
45 '../../extlibs/yaml/yaml/include'
48 # Including Java path for building JNI files
50 os.environ['JAVA_HOME']
53 *************************************** Error *********************************
54 * JAVA_HOME environment variable not set
55 * Simulator has dependency on java, Please set environment variable JAVA_HOME
56 *******************************************************************************
60 java_headers = [os.path.join(os.environ['JAVA_HOME'], 'include')]
61 java_headers.append(os.path.join(java_headers[0], 'win32'))
62 java_headers.append(os.path.join(java_headers[0], 'linux'))
63 java_headers.append(os.path.join(java_headers[0], 'solaris'))
64 simulator_env.AppendUnique(CPPPATH = java_headers)
66 simulator_env.AppendUnique(CPPPATH = ['../../extlibs/cjson'])
67 simulator_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'libcoap','RamlParser','YamlParser'])
68 simulator_env.AppendUnique(LIBS = ['pthread'])
70 simulator_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
72 ######################################################################
73 # Source files and Targets
74 ######################################################################
75 simulator_src = [env.Glob('src/*.cpp'), env.Glob('java/jni/*.cpp')]
76 simulatorsdk = simulator_env.SharedLibrary('SimulatorManager', simulator_src)
78 simulator_env.InstallTarget(simulatorsdk, 'libSimulator')
80 #Build sample application
81 SConscript('examples/server/SConscript')
82 SConscript('examples/client-controller/SConscript')
84 SConscript('ramlparser/SConscript')