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 # easy-setup project build script
27 # Add third party libraries
29 #SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env')
31 easy_setup_env = lib_env.Clone()
32 target_os = env.get('TARGET_OS')
33 ######################################################################
35 ######################################################################
36 easy_setup_env.AppendUnique(CPPPATH = ['sdk/inc', 'sdk/src'])
38 if target_os not in ['windows', 'winrt']:
39 easy_setup_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
40 if target_os not in ['android', 'arduino']:
41 easy_setup_env.AppendUnique(CXXFLAGS = ['-pthread'])
43 if target_os == 'android':
44 easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
45 easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'gnustl_shared'])
47 if target_os == 'arduino':
48 easy_setup_env.AppendUnique(CPPPATH = [
49 '../../resource/oc_logger/include',
50 '../../resource/csdk/logger/include',
51 '../../resource/csdk/stack/include',
52 '../../extlibs/cjson',
53 'sdk/arduino/wifi/inc',
54 'sdk/arduino/wifi/src' ])
56 ######################################################################
57 # Source files and Targets
58 ######################################################################
60 #if target_os == 'arduino':
61 es_src = env.Glob('sdk/src/*.cpp')
62 es_src += env.Glob('sdk/arduino/wifi/src/*.cpp')
63 es_sdk_static = easy_setup_env.StaticLibrary('ESSDKLibrary', es_src)
64 easy_setup_env.InstallTarget(es_sdk_static, 'libESSDK')
66 if target_os == 'android':
67 es_src = env.Glob('sdk/src/*.cpp')
68 es_src += env.Glob('sdk/android/wifi/src/*.cpp')
69 es_sdk_static = easy_setup_env.StaticLibrary('ESLib', es_src)
70 es_sdk_shared = easy_setup_env.SharedLibrary('ESLib', es_src)
71 easy_setup_env.InstallTarget([es_sdk_static, es_sdk_shared], 'libESSDK')
74 #if target_os == 'android':
75 # SConscript(os.path.join('sdk', 'java', 'jni', 'SConscript'))
77 #Go to build sample apps
78 SConscript('sampleapp/SConscript')