Skip to content

Commit 5e3bb75

Browse files
Merge pull request #1334 from adrian-prantl/64169273-next
Replace hand-written make rules with generic ones
2 parents 0a853f4 + 69952a9 commit 5e3bb75

File tree

3 files changed

+11
-26
lines changed

3 files changed

+11
-26
lines changed

lldb/packages/Python/lldbsuite/test/make/Makefile.rules

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -833,10 +833,12 @@ endif
833833
$(DYLIB_FILENAME) : $(DYLIB_OBJECTS)
834834
@echo "### Linking dynamic library $(DYLIB_NAME)"
835835
ifneq "$(EXCLUDE_WRAPPED_SWIFTMODULE)" ""
836-
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -emit-library $(DYLIB_SWIFT_FLAGS) -o $@ \
836+
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -toolchain-stdlib-rpath \
837+
-emit-library $(DYLIB_SWIFT_FLAGS) -o $@ \
837838
$(patsubst %.swiftmodule.o,,$^)
838839
else
839-
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -emit-library $(DYLIB_SWIFT_FLAGS) -o $@ $^
840+
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -toolchain-stdlib-rpath \
841+
-emit-library $(DYLIB_SWIFT_FLAGS) -o $@ $^
840842
endif
841843
ifneq "$(CODESIGN)" ""
842844
$(CODESIGN) -s - "$(DYLIB_FILENAME)"

lldb/test/API/lang/swift/expression/objc_context/Makefile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
SWIFT_OBJC_INTEROP := 1
1+
OBJC_SOURCES := main.m
2+
CFLAGS_EXTRAS = $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(BUILDDIR)
3+
LD_EXTRAS = -lFoo -L$(BUILDDIR)
24

35
# This test builds an Objective-C main program that imports two Swift
46
# .dylibs with conflicting ClangImporter search paths.
57

6-
include Makefile.rules
8+
all: libFoo.dylib $(EXE)
79

8-
a.out: main.m libFoo.dylib
9-
$(CC) $(CFLAGS) $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(shell pwd) -lFoo -L$(shell pwd) -o $@ $<
10-
ifneq "$(CODESIGN)" ""
11-
$(CODESIGN) -s - "$@"
12-
endif
10+
include Makefile.rules
1311

1412
lib%.dylib: %.swift
1513
$(MAKE) MAKE_DSYM=YES CC=$(CC) SWIFTC=$(SWIFTC) \

lldb/test/API/lang/swift/expression/objc_context/TestSwiftExpressionObjCContext.py

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import lldbsuite.test.lldbutil as lldbutil
1717
import os
1818
import unittest2
19-
import shutil
2019

2120
class TestSwiftExpressionObjCContext(TestBase):
2221

@@ -29,20 +28,12 @@ def setUp(self):
2928
@swiftTest
3029
def test(self):
3130
self.build()
32-
exe_name = "a.out"
33-
exe = self.getBuildArtifact(exe_name)
34-
35-
# Create the target
36-
target = self.dbg.CreateTarget(exe)
37-
self.assertTrue(target, VALID_TARGET)
3831

3932
# Register shlib so it can run on-device.
33+
target, _, _, _ = lldbutil.run_to_source_breakpoint(
34+
self, "break here", lldb.SBFileSpec('main.m'))
4035
self.registerSharedLibrariesWithTarget(target, ['Foo'])
4136

42-
# Set the breakpoints
43-
foo_breakpoint = target.BreakpointCreateBySourceRegex(
44-
'break here', lldb.SBFileSpec('main.m'))
45-
process = target.LaunchSimple(None, None, os.getcwd())
4637
# This is expected to fail because we can't yet import ObjC
4738
# modules into a Swift context.
4839
self.expect("expr -lang Swift -- Bar()", "failure",
@@ -51,10 +42,4 @@ def test(self):
5142
self.expect("expr -lang Swift -- [1, 2, 3]",
5243
"context-less swift expression works",
5344
substrs=["([Int])"])
54-
5545

56-
if __name__ == '__main__':
57-
import atexit
58-
lldb.SBDebugger.Initialize()
59-
atexit.register(lldb.SBDebugger.Terminate)
60-
unittest2.main()

0 commit comments

Comments
 (0)