summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/prepare_bindings.py
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-03-11 01:57:45 +0000
committerJim Ingham <jingham@apple.com>2016-03-11 01:57:45 +0000
commitd815c9ab88fd537f7d54c0a6bd0fc6d7f4361c23 (patch)
tree59dafafbe61537f293d7e98776ee6c8fa1237d2f /lldb/scripts/prepare_bindings.py
parentb1069239a0260bf9998a6da15a6d10778274ba45 (diff)
downloadbcm5719-llvm-d815c9ab88fd537f7d54c0a6bd0fc6d7f4361c23.tar.gz
bcm5719-llvm-d815c9ab88fd537f7d54c0a6bd0fc6d7f4361c23.zip
Fix SBDebugger.GetOutputFileHandle() on OS X.
The swig typemaps had some magic for output File *'s on OS X that made: SBDebugger.GetOutputFileHandle() actually work. That was protected by a "#ifdef __MACOSX__", but the corresponding define got lost going from the Darwin shell scripts to the python scripts for running swig, so the code was elided. I need to pass the define to SWIG, but only when targetting Darwin. So I added a target-platform argument to prepare_bindings, and if that is Darwin, I pass -D__APPLE__ to swig, and that activates this code again, and GetOutputFileHandle works again. Note, I only pass that argument for the Xcode build. I'm sure it is possible to do that for cmake, but my cmake-foo is weak. I should have been able to write a test for this by creating a debugger, setting the output file handle to something file, writing to it, getting the output file handle and reading it. But SetOutputFileHandle doesn't seem to work from Python, so I'd have to write a pexpect test to test this, which I'd rather not do. llvm-svn: 263183
Diffstat (limited to 'lldb/scripts/prepare_bindings.py')
-rwxr-xr-xlldb/scripts/prepare_bindings.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/scripts/prepare_bindings.py b/lldb/scripts/prepare_bindings.py
index 3165f232e5e..6d70f5bf421 100755
--- a/lldb/scripts/prepare_bindings.py
+++ b/lldb/scripts/prepare_bindings.py
@@ -152,6 +152,11 @@ def process_args(args):
"Specifies the build dir where the language binding "
"should be placed"))
+ parser.add_argument(
+ "--target-platform",
+ help=(
+ "Specifies the platform we are building for."
+ "Should be the same as what platform.system() returns."))
# Process args.
options = parser.parse_args(args)
OpenPOWER on IntegriCloud