Adding an IoTivity/Zigbee sample server
[platform/upstream/iotivity.git] / plugins / src / SConscript
1 ##
2 # Plugin Interface build script
3 ##
4
5 import os.path
6
7 Import('env')
8
9 target_os = env.get('TARGET_OS')
10 src_dir = env.get('SRC_DIR')
11 pi_path = os.path.join(src_dir, 'plugins')
12
13 #####################################################################
14 # Source files and Target(s)
15 ######################################################################
16
17 print"Reading PI script"
18
19 env.PrependUnique(CPPPATH = [ os.path.join(src_dir, 'resource', 'csdk', 'stack', 'include') ])
20 env.AppendUnique(CPPPATH = [ os.path.join(pi_path, 'include'),
21                              os.path.join(pi_path, 'include', 'internal') ])
22
23 if target_os not in ['arduino', 'windows', 'winrt']:
24         env.AppendUnique(CPPDEFINES = ['WITH_POSIX'])
25
26 if target_os in ['darwin','ios']:
27         env.AppendUnique(CPPDEFINES = ['_DARWIN_C_SOURCE'])
28
29 pi_src = [
30         'plugininterface.c',
31         ]
32
33 env.AppendUnique(PI_SRC = pi_src)
34
35 print "Include path is %s" % env.get('CPPPATH')
36 print "Files path is %s" % env.get('PI_SRC')
37 if target_os in ['android', 'tizen']:
38         calib = env.SharedLibrary('plugin_interface', env.get('PI_SRC'))
39 else:
40         calib = env.StaticLibrary('plugin_interface', env.get('PI_SRC'))
41 env.InstallTarget(calib, 'libplugin_interface')
42 env.UserInstallTargetLib(calib, 'libplugin_interface')
43