aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Dmitry Shevchenko <dmishe@google.com>2016-08-11 23:19:43 +0000
committerGravatar Yue Gan <yueg@google.com>2016-08-12 08:54:20 +0000
commita85fabc3d065643a69a0e31c198f98de313ca6df (patch)
tree6b89feeb6202a8b90725556e23091f246f3fcc49
parent2c5d51712814d0e1f624364a013fc21795db3eda (diff)
Include the location of the current swiftmodule for LLDB.
* LLDB spawns an instance of Swift compiler under the hood, which is configured via command line flags recorded in DWARF at the time of compilation. In order for LLDB to properly import the module for the target being built, that command line has to provide a path to that module. -- MOS_MIGRATED_REVID=130045157
-rw-r--r--tools/build_defs/apple/swift.bzl3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/build_defs/apple/swift.bzl b/tools/build_defs/apple/swift.bzl
index fe0ca853f1..9f0889c432 100644
--- a/tools/build_defs/apple/swift.bzl
+++ b/tools/build_defs/apple/swift.bzl
@@ -134,6 +134,9 @@ def _swift_library_impl(ctx):
# Include each swift module's parent directory for imports to work.
include_dirs = set([x.dirname for x in dep_modules])
+ # Include the parent directory of the resulting module so LLDB can find it.
+ include_dirs += set([output_module.dirname])
+
include_args = ["-I%s" % d for d in include_dirs + objc_includes]
framework_args = ["-F%s" % x for x in framework_dirs]
define_args = ["-D%s" % x for x in ctx.attr.defines]