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
46 java_home = ARGUMENTS.get('JAVA_HOME', 0)
49 *************************************** Error *********************************
50 * JAVA_HOME variable not set in scons command *
51 *******************************************************************************
54 java_headers = [os.path.join(java_home, 'include')]
55 java_headers.append(os.path.join(java_headers[0], 'win32'))
56 java_headers.append(os.path.join(java_headers[0], 'linux'))
57 java_headers.append(os.path.join(java_headers[0], 'solaris'))
58 simulator_env.AppendUnique(CPPPATH = java_headers)
60 simulator_env.AppendUnique(CPPPATH = ['../../extlibs/cjson'])
61 simulator_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'libcoap'])
62 simulator_env.AppendUnique(LIBS = ['pthread'])
64 simulator_env.AppendUnique(CXXFLAGS = ['-O2', '-g', '-Wall', '-fmessage-length=0', '-std=c++0x'])
66 ######################################################################
67 # Source files and Targets
68 ######################################################################
69 simulator_src = [env.Glob('src/*.cpp'), env.Glob('java/jni/*.cpp')]
70 simulatorsdk = simulator_env.SharedLibrary('SimulatorManager', simulator_src)
72 simulator_env.InstallTarget(simulatorsdk, 'libSimulator')
74 #Build sample application
75 SConscript('examples/server/SConscript')