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
29 env.AppendUnique(CPPDEFINES = ['EASY_SETUP_CA_INIT'])
31 easy_setup_env = env.Clone()
32 target_os = env.get('TARGET_OS')
35 if target_os == 'android':
36 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env')
38 ######################################################################
40 ######################################################################
41 easy_setup_env.AppendUnique(CPPPATH = ['sdk/inc', 'sdk/src', 'sdk/common'])
43 if target_os not in ['windows', 'winrt']:
44 easy_setup_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
45 if target_os not in ['android', 'arduino']:
46 easy_setup_env.AppendUnique(CXXFLAGS = ['-pthread'])
48 if target_os in ['android', 'linux']:
49 easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
50 easy_setup_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
51 easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
52 if target_os not in ['linux', 'arduino']:
53 easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'gnustl_shared'])
55 easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction'])
57 if not env.get('RELEASE'):
58 easy_setup_env.AppendUnique(LIBS = ['log'])
61 if target_os == 'arduino':
62 easy_setup_env.AppendUnique(CPPPATH = [
63 '../../resource/oc_logger/include',
64 '../../resource/csdk/logger/include',
65 '../../resource/csdk/stack/include',
66 '../../extlibs/cjson',
67 'sdk/enrollee/arduino/wifi',
68 'sdk/enrollee/common/src',
69 'sdk/enrollee/common/inc'])
71 if target_os in ['android','linux']:
72 easy_setup_env.PrependUnique(CPPPATH = [
73 env.get('SRC_DIR') + '/resource/csdk/ocmalloc/include',
74 env.get('SRC_DIR') + '/resource/csdk/connectivity/common/inc',
75 env.get('SRC_DIR') + '/resource/csdk/connectivity/api',
76 env.get('SRC_DIR') + '/resource/csdk/stack/include',
77 env.get('SRC_DIR') + '/resource/csdk/logger/include',
78 env.get('SRC_DIR') + '/resource/csdk/security/include',
79 env.get('SRC_DIR') + '/extlibs/cjson'
82 ######################################################################
83 # Source files and Targets
84 ######################################################################
86 if target_os == 'arduino':
87 es_sdk_static = easy_setup_env.StaticLibrary('ESSDKLibrary',
88 ['sdk/enrollee/common/src/easysetup.cpp',
89 'sdk/enrollee/common/src/resourceHandler.cpp',
90 'sdk/enrollee/arduino/wifi/networkHandler.cpp'])
91 easy_setup_env.InstallTarget(es_sdk_static, 'libESSDK')
94 if target_os == 'android':
95 es_sdk_shared = easy_setup_env.SharedLibrary('libESSDK',
96 ['sdk/src/easysetupmgr.cpp',
97 'sdk/src/camutex_pthreads.c',
98 'sdk/src/provisioninghandler.cpp'])
99 easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK')
101 if target_os == 'linux':
102 es_sdk_shared = easy_setup_env.SharedLibrary('ESSDKLibrary',
103 ['sdk/src/easysetupmgr.cpp',
104 'sdk/src/camutex_pthreads.c',
105 'sdk/src/provisioninghandler.cpp'])
106 easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK')
108 #Go to build sample apps
109 SConscript('sampleapp/SConscript')