SConstruct (4494:b7c909b5a5e9) | SConstruct (4554:9beeb46559ec) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 256 unchanged lines hidden (view full) --- 265 266min_swig_version = '1.3.28' 267if compare_versions(swig_version[2], min_swig_version) < 0: 268 print 'Error: SWIG version', min_swig_version, 'or newer required.' 269 print ' Installed version:', swig_version[2] 270 Exit(1) 271 272# Set up SWIG flags & scanner | 1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 256 unchanged lines hidden (view full) --- 265 266min_swig_version = '1.3.28' 267if compare_versions(swig_version[2], min_swig_version) < 0: 268 print 'Error: SWIG version', min_swig_version, 'or newer required.' 269 print ' Installed version:', swig_version[2] 270 Exit(1) 271 272# Set up SWIG flags & scanner |
273env.Append(SWIGFLAGS=Split('-c++ -python -modern $_CPPINCFLAGS')) | 273swig_flags=Split('-c++ -python -modern -templatereduce $_CPPINCFLAGS') 274env.Append(SWIGFLAGS=swig_flags) |
274 | 275 |
275import SCons.Scanner | 276# filter out all existing swig scanners, they mess up the dependency 277# stuff for some reason 278scanners = [] 279for scanner in env['SCANNERS']: 280 skeys = scanner.skeys 281 if skeys == '.i': 282 continue 283 284 if isinstance(skeys, (list, tuple)) and '.i' in skeys: 285 continue |
276 | 286 |
287 scanners.append(scanner) 288 289# add the new swig scanner that we like better 290from SCons.Scanner import ClassicCPP as CPPScanner |
|
277swig_inc_re = '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")' | 291swig_inc_re = '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")' |
292scanners.append(CPPScanner("SwigScan", [ ".i" ], "CPPPATH", swig_inc_re)) |
|
278 | 293 |
279swig_scanner = SCons.Scanner.ClassicCPP("SwigScan", ".i", "CPPPATH", 280 swig_inc_re) | 294# replace the scanners list that has what we want 295env['SCANNERS'] = scanners |
281 | 296 |
282env.Append(SCANNERS = swig_scanner) 283 | |
284# Platform-specific configuration. Note again that we assume that all 285# builds under a given build root run on the same host platform. 286conf = Configure(env, 287 conf_dir = joinpath(build_root, '.scons_config'), 288 log_file = joinpath(build_root, 'scons_config.log')) 289 290# Find Python include and library directories for embedding the 291# interpreter. For consistency, we will use the same Python --- 386 unchanged lines hidden --- | 297# Platform-specific configuration. Note again that we assume that all 298# builds under a given build root run on the same host platform. 299conf = Configure(env, 300 conf_dir = joinpath(build_root, '.scons_config'), 301 log_file = joinpath(build_root, 'scons_config.log')) 302 303# Find Python include and library directories for embedding the 304# interpreter. For consistency, we will use the same Python --- 386 unchanged lines hidden --- |