#****************************************************************** # # Copyright 2014 Samsung Electronics All Rights Reserved. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ## # easy-setup project build script ## import os Import('env') # Add third party libraries lib_env = env.Clone() #SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env') easy_setup_env = lib_env.Clone() target_os = env.get('TARGET_OS') ###################################################################### # Build flags ###################################################################### easy_setup_env.AppendUnique(CPPPATH = ['sdk/inc', 'sdk/src']) if target_os not in ['windows', 'winrt']: easy_setup_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall']) if target_os not in ['android', 'arduino']: easy_setup_env.AppendUnique(CXXFLAGS = ['-pthread']) if target_os == 'android': easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions']) easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'gnustl_shared']) if target_os == 'arduino': easy_setup_env.AppendUnique(CPPPATH = [ '../../resource/oc_logger/include', '../../resource/csdk/logger/include', '../../resource/csdk/stack/include', '../../extlibs/cjson', 'sdk/arduino/wifi/inc', 'sdk/arduino/wifi/src' ]) ###################################################################### # Source files and Targets ###################################################################### #if target_os == 'arduino': es_src = env.Glob('sdk/src/*.cpp') es_src += env.Glob('sdk/arduino/wifi/src/*.cpp') es_sdk_static = easy_setup_env.StaticLibrary('ESSDKLibrary', es_src) easy_setup_env.InstallTarget(es_sdk_static, 'libESSDK') if target_os == 'android': es_src = env.Glob('sdk/src/*.cpp') es_src += env.Glob('sdk/android/wifi/src/*.cpp') es_sdk_static = easy_setup_env.StaticLibrary('ESLib', es_src) es_sdk_shared = easy_setup_env.SharedLibrary('ESLib', es_src) easy_setup_env.InstallTarget([es_sdk_static, es_sdk_shared], 'libESSDK') # Build JNI layer #if target_os == 'android': # SConscript(os.path.join('sdk', 'java', 'jni', 'SConscript')) #Go to build sample apps SConscript('sampleapp/SConscript')