source: trunk/src/SConscript @ 1822

Revision 1106, 2.6 KB checked in by Freddie Akeroyd, 4 years ago (diff)

Windows scons tidy ups. Refs #112.

  • Property svn:keywords set to HeadURL LastChangedBy LastChangedRevision LastChangedDate
Line 
1#====================================================================
2#  NeXus - Neutron & X-ray Common Data Format
3
4#  $Id: Makefile.am 961 2007-09-04 12:31:49Z Freddie Akeroyd $
5#
6#  Top level scons file for coordinating NeXus build
7
8#  Copyright (C) 2008 Freddie Akeroyd
9
10#  This library is free software; you can redistribute it and/or
11#  modify it under the terms of the GNU Lesser General Public
12#  License as published by the Free Software Foundation; either
13#  version 2 of the License, or (at your option) any later version.
14#
15#  This library is distributed in the hope that it will be useful,
16#  but WITHOUT ANY WARRANTY; without even the implied warranty of
17#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18#  Lesser General Public License for more details.
19#
20#  You should have received a copy of the GNU Lesser General Public
21#  License along with this library; if not, write to the Free
22#  Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
23#  MA  02111-1307  USA
24#             
25#  For further information, see <http://www.nexusformat.org/>
26#
27######################## Subversion Reposity details ########################
28# Repository Location     $HeadURL$
29# Revision of last commit $LastChangedRevision$
30# Date of last commit     $LastChangedDate$
31# Author of last commit   $LastChangedBy$
32############################################################################
33
34import os
35import platform
36import sys
37import shutil
38import re
39import os
40import nexus_scons_utils
41
42source_files = Split("""napi4.c
43                        napi5.c
44                        nxxml.c
45                        nxio.c
46                        napi.c
47                        napiu.c
48                        nxdataset.c
49                        nxstack.c
50                        stptok.c""")
51
52
53#Import environment
54Import('env')
55myenv = env.Clone()
56myenv.Append(CPPDEFINES=[('IN_NEXUS_LIBRARY',1),('H5_USE_16_API',1)])
57myenv.Append(CPPPATH=['#/include'])
58#print myenv.Dump()
59
60if os.name == 'nt':
61    source_files.extend(['napi_exports.c','napi_exports2.c'])
62    mydef=File('#/Windows_extra/libNeXus-0.def')
63    myenv.Append(SHLINKFLAGS=['/DEF:'+str(mydef)])
64
65shared_objects = nexus_scons_utils.getSharedObjects(source_files, myenv)
66
67#BUILD CODE
68static = myenv.StaticLibrary('libstatic/libNeXus-0', source_files, LIBS=env['MYLIBLIST'], LIBPATH=env['MYLIBDIRLIST'], PDB='libstatic/libNeXus-0.pdb')
69shared = myenv.SharedLibrary('lib/libNeXus-0', source_files, LIBS=env['MYSHLIBLIST'], LIBPATH=env['MYSHLIBDIRLIST'], PDB='lib/libNeXus-0.pdb')
70retval = { 'shared': shared, 'static': static, 'sharedobjs' : shared_objects, 'libs': [ 'libNeXus-0' ] }
71Return('retval')
Note: See TracBrowser for help on using the repository browser.