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'])
54 if not env.get('RELEASE'):
55 easy_setup_env.AppendUnique(LIBS = ['log'])
57 easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction'])
59 if target_os == 'arduino':
60 easy_setup_env.AppendUnique(CPPPATH = [
61 '../../resource/oc_logger/include',
62 '../../resource/csdk/logger/include',
63 '../../resource/csdk/stack/include',
64 '../../extlibs/cjson',
65 'sdk/enrollee/arduino/wifi',
66 'sdk/enrollee/common/src',
67 'sdk/enrollee/common/inc'])
69 if target_os in ['android','linux']:
70 easy_setup_env.PrependUnique(CPPPATH = [
71 env.get('SRC_DIR') + '/resource/c_common/oic_malloc/include',
72 env.get('SRC_DIR') + '/resource/csdk/connectivity/common/inc',
73 env.get('SRC_DIR') + '/resource/csdk/connectivity/api',
74 env.get('SRC_DIR') + '/resource/csdk/stack/include',
75 env.get('SRC_DIR') + '/resource/csdk/logger/include',
76 env.get('SRC_DIR') + '/resource/csdk/security/include',
77 env.get('SRC_DIR') + '/extlibs/cjson',
81 ######################################################################
82 # Source files and Targets
83 ######################################################################
85 if target_os == 'arduino':
86 es_sdk_static = easy_setup_env.StaticLibrary('ESSDKLibrary',
87 ['sdk/enrollee/common/src/easysetup.cpp',
88 'sdk/enrollee/common/src/resourceHandler.cpp',
89 'sdk/enrollee/arduino/wifi/networkHandler.cpp'])
90 easy_setup_env.InstallTarget(es_sdk_static, 'libESSDK')
93 if target_os == 'android':
94 es_sdk_shared = easy_setup_env.StaticLibrary('libESSDK',
95 ['sdk/mediator/src/easysetupmgr.cpp',
96 'sdk/mediator/src/camutex_pthreads.c',
97 'sdk/mediator/src/provisioninghandler.cpp'])
98 easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK')
100 if target_os == 'linux':
101 es_sdk_shared = easy_setup_env.SharedLibrary('ESSDKLibrary',
102 ['sdk/mediator/src/easysetupmgr.cpp',
103 'sdk/mediator/src/camutex_pthreads.c',
104 'sdk/mediator/src/provisioninghandler.cpp'])
105 easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK')
107 #Go to build sample apps
108 SConscript('sampleapp/SConscript')