Fix build error with scons-4.4.0 version which is based on python3
[platform/upstream/iotivity.git] / service / easy-setup / sampleapp / enrollee / arduino / SConscript
1 #******************************************************************
2 #
3 # Copyright 2015 Samsung Electronics All Rights Reserved.
4 #
5 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #
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
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
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.
18 #
19 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 ######################################################################
22 # Build script for Arduino Enrollee Sample App
23 ######################################################################
24
25 Import('env')
26
27 enrollee_env = env.Clone()
28 transport = enrollee_env.get('TARGET_TRANSPORT')
29
30 ######################################################################
31 # Build flags
32 ######################################################################
33 enrollee_env.PrependUnique(CPPPATH = [
34         env.get('SRC_DIR') + '/resource/oc_logger/include',
35         env.get('SRC_DIR') + '/resource/csdk/logger/include',
36         env.get('SRC_DIR') + '/resource/csdk/stack/include',
37                 env.get('SRC_DIR') + '/extlibs/cjson',
38                 env.get('SRC_DIR') + '/service/easy-setup/inc',
39                 env.get('SRC_DIR') + '/service/easy-setup/enrollee/arduino/wifi',
40                 env.get('SRC_DIR') + '/service/easy-setup/enrollee/inc',
41                 env.get('SRC_DIR') + '/service/easy-setup/enrollee/src'])
42
43 enrollee_env.AppendUnique(CPPDEFINES = ['TB_LOG', 'ESWIFI'])
44
45 enrollee_env.AppendUnique(LIBPATH = [env.get('BUILD_DIR')])
46
47 enrollee_env.PrependUnique(LIBS = ['octbstack','ocsrm','connectivity_abstraction','coap', 'ESEnrolleeSDK'])
48 enrollee = enrollee_env.Program('enrollee', 'enrolleewifi.cpp')
49 env.CreateBin('enrollee')
50
51 i_enrollee = enrollee_env.Install(env.get('BUILD_DIR'), enrollee)
52
53 Alias('enrollee', i_enrollee)
54 env.AppendTarget('enrollee')
55
56 if(enrollee_env['UPLOAD'] == True):
57         from sys import platform as _platform
58         if _platform == "linux" or _platform == "linux2":
59                 enrollee_env.Upload(env.get('BUILD_DIR') + '/service/easy-setup/sampleapp/enrollee/arduino/enrollee.hex')
60         else:
61                 print('Please use appropriate install method for your developing machine. Linux is the only supported platform right now.')