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 transport = env.get('TARGET_TRANSPORT')
31 env.AppendUnique(CPPDEFINES = ['EASY_SETUP_CA_INIT'])
33 easy_setup_env = env.Clone()
35 target_os = env.get('TARGET_OS')
38 if target_os == 'android':
39 SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env')
41 ######################################################################
43 ######################################################################
44 easy_setup_env.AppendUnique(CPPPATH = ['sdk/inc', 'sdk/src', 'sdk/common'])
46 if target_os not in ['windows', 'winrt']:
47 easy_setup_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
48 if target_os not in ['android', 'arduino']:
49 easy_setup_env.AppendUnique(CXXFLAGS = ['-pthread'])
51 if target_os in ['android', 'linux']:
52 easy_setup_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
53 easy_setup_env.AppendUnique(RPATH = [env.get('BUILD_DIR')])
54 easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
55 if target_os not in ['linux', 'arduino']:
56 easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'connectivity_abstraction', 'gnustl_shared'])
57 if not env.get('RELEASE'):
58 easy_setup_env.AppendUnique(LIBS = ['log'])
60 easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'oc_logger', 'pthread', 'connectivity_abstraction'])
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'])
70 easy_setup_env.AppendUnique(CPPDEFINES = ['TB_LOG', 'ESWIFI'])
71 if target_os in ['android','linux']:
72 easy_setup_env.PrependUnique(CPPPATH = [
73 env.get('SRC_DIR') + '/resource/c_common/oic_malloc/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',
83 ######################################################################
84 # Source files and Targets
85 ######################################################################
87 if target_os == 'arduino':
88 es_sdk_static = easy_setup_env.StaticLibrary('ESSDKLibrary',
89 ['sdk/enrollee/common/src/easysetup.cpp',
90 'sdk/enrollee/common/src/resourceHandler.cpp',
91 'sdk/enrollee/arduino/wifi/networkHandler.cpp'])
92 easy_setup_env.InstallTarget(es_sdk_static, 'libESSDK')
94 if target_os == 'android':
95 es_sdk_shared = easy_setup_env.StaticLibrary('libESSDK',
96 ['sdk/mediator/src/prov_adapter.cpp',
97 'sdk/mediator/src/wifi_provisioning.cpp',
98 'sdk/mediator/src/provisioning.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/mediator/src/prov_adapter.cpp',
104 'sdk/mediator/src/wifi_provisioning.cpp',
105 'sdk/mediator/src/provisioning.cpp'])
106 easy_setup_env.InstallTarget(es_sdk_shared, 'libESSDK')
108 #Go to build sample apps
109 SConscript('sampleapp/SConscript')