Add an initial prototype of Multi-Phy Easy Setup service for Arduino device
[platform/upstream/iotivity.git] / service / easy-setup / SConscript
1 #******************************************************************
2 #
3 # Copyright 2014 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 # easy-setup project build script
23 ##
24 import os
25 Import('env')
26
27 # Add third party libraries
28 lib_env = env.Clone()
29 #SConscript(env.get('SRC_DIR') + '/service/third_party_libs.scons', exports = 'lib_env')
30
31 easy_setup_env = lib_env.Clone()
32 target_os = env.get('TARGET_OS')
33 ######################################################################
34 # Build flags
35 ######################################################################
36 easy_setup_env.AppendUnique(CPPPATH = ['sdk/inc', 'sdk/src'])
37
38 if target_os not in ['windows', 'winrt']:
39     easy_setup_env.AppendUnique(CXXFLAGS = ['-std=c++0x', '-Wall'])
40     if target_os not in ['android', 'arduino']:
41         easy_setup_env.AppendUnique(CXXFLAGS = ['-pthread'])
42
43 if target_os == 'android':
44     easy_setup_env.AppendUnique(CXXFLAGS = ['-frtti', '-fexceptions'])
45     easy_setup_env.PrependUnique(LIBS = ['oc', 'octbstack', 'gnustl_shared'])
46
47 if target_os == 'arduino':
48    easy_setup_env.AppendUnique(CPPPATH = [
49                                        '../../resource/oc_logger/include',
50                                        '../../resource/csdk/logger/include',
51                                        '../../resource/csdk/stack/include',
52                                        '../../extlibs/cjson',
53                                        'sdk/arduino/wifi/inc', 
54                                        'sdk/arduino/wifi/src' ])
55
56 ######################################################################
57 # Source files and Targets
58 ######################################################################
59
60 #if target_os == 'arduino':
61    es_src = env.Glob('sdk/src/*.cpp')
62    es_src += env.Glob('sdk/arduino/wifi/src/*.cpp')
63    es_sdk_static = easy_setup_env.StaticLibrary('ESSDKLibrary', es_src)
64    easy_setup_env.InstallTarget(es_sdk_static, 'libESSDK')
65
66 if target_os == 'android':
67    es_src = env.Glob('sdk/src/*.cpp')
68    es_src += env.Glob('sdk/android/wifi/src/*.cpp')     
69    es_sdk_static = easy_setup_env.StaticLibrary('ESLib', es_src)
70    es_sdk_shared = easy_setup_env.SharedLibrary('ESLib', es_src)
71    easy_setup_env.InstallTarget([es_sdk_static, es_sdk_shared], 'libESSDK')
72
73 # Build JNI layer
74 #if target_os == 'android':
75 #    SConscript(os.path.join('sdk', 'java', 'jni', 'SConscript'))
76
77 #Go to build sample apps
78 SConscript('sampleapp/SConscript')
79
80