OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Wrapper around swig. | 6 """Wrapper around swig. |
7 | 7 |
8 Sets the SWIG_LIB environment var to point to Lib dir | 8 Sets the SWIG_LIB environment var to point to Lib dir |
9 and defers control to the platform-specific swig binary. | 9 and defers control to the platform-specific swig binary. |
10 | 10 |
11 Depends on swig binaries being available at ../../third_party/swig. | 11 Depends on swig binaries being available at ../../third_party/swig. |
(...skipping 20 matching lines...) Expand all Loading... |
32 platform_flags = { | 32 platform_flags = { |
33 'darwin': '-DSWIGMAC', | 33 'darwin': '-DSWIGMAC', |
34 'linux2': '-DSWIGLINUX', | 34 'linux2': '-DSWIGLINUX', |
35 'linux3': '-DSWIGLINUX', | 35 'linux3': '-DSWIGLINUX', |
36 'win32': '-DSWIGWIN', | 36 'win32': '-DSWIGWIN', |
37 } | 37 } |
38 swig_bin = os.path.join(swig_dir, dir_map[sys.platform], 'swig') | 38 swig_bin = os.path.join(swig_dir, dir_map[sys.platform], 'swig') |
39 args = [swig_bin, platform_flags[sys.platform]] + sys.argv[1:] | 39 args = [swig_bin, platform_flags[sys.platform]] + sys.argv[1:] |
40 args = [x.replace('/', os.sep) for x in args] | 40 args = [x.replace('/', os.sep) for x in args] |
41 print "Executing", args | 41 print "Executing", args |
42 sys.exit(subprocess.call(args)) | 42 return subprocess.call(args) |
43 | 43 |
44 | 44 |
45 if __name__ == "__main__": | 45 if __name__ == "__main__": |
46 main() | 46 sys.exit(main()) |
47 | |
OLD | NEW |