summaryrefslogtreecommitdiffstats
path: root/tools/swig
diff options
context:
space:
mode:
authornirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 20:59:35 +0000
committernirnimesh@chromium.org <nirnimesh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-27 20:59:35 +0000
commit9f341ec6c421b2b950a0f710eb27051309c44337 (patch)
tree983b6e2dced96d10456c7d25628a9a8547122728 /tools/swig
parentaa85ee9dad370549eb3f07d01a54d352b8e2b1e3 (diff)
downloadchromium_src-9f341ec6c421b2b950a0f710eb27051309c44337.zip
chromium_src-9f341ec6c421b2b950a0f710eb27051309c44337.tar.gz
chromium_src-9f341ec6c421b2b950a0f710eb27051309c44337.tar.bz2
Wrapper script for running swig.
BUG=32285 TEST=mac build should compile Review URL: http://codereview.chromium.org/556036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37305 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/swig')
-rwxr-xr-xtools/swig/swig.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/swig/swig.py b/tools/swig/swig.py
new file mode 100755
index 0000000..332ec2a
--- /dev/null
+++ b/tools/swig/swig.py
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Wrapper around swig.
+
+Sets the SWIG_LIB environment var to point to Lib dir
+and defers control to the platform-specific swig binary.
+
+Depends on swig binaries being available at ../../third_party/swig.
+"""
+
+import os
+import sys
+
+
+def main():
+ swig_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]),
+ os.pardir, os.pardir, 'third_party', 'swig'))
+ lib_dir = os.path.join(swig_dir, "Lib")
+ os.putenv("SWIG_LIB", lib_dir)
+ dir_map = {
+ 'darwin': 'mac',
+ 'linux2': 'linux',
+ 'win32': 'win',
+ 'cygwin': 'win',
+ }
+ swig_bin = os.path.join(swig_dir, dir_map[sys.platform], 'swig')
+ os.execv(swig_bin, [swig_bin] + sys.argv[1:])
+
+
+if __name__ == "__main__":
+ main()
+