Skip to content

Replace hand-written make rules with generic ones #1334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lldb/packages/Python/lldbsuite/test/make/Makefile.rules
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,12 @@ endif
$(DYLIB_FILENAME) : $(DYLIB_OBJECTS)
@echo "### Linking dynamic library $(DYLIB_NAME)"
ifneq "$(EXCLUDE_WRAPPED_SWIFTMODULE)" ""
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -emit-library $(DYLIB_SWIFT_FLAGS) -o $@ \
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -toolchain-stdlib-rpath \
-emit-library $(DYLIB_SWIFT_FLAGS) -o $@ \
$(patsubst %.swiftmodule.o,,$^)
else
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -emit-library $(DYLIB_SWIFT_FLAGS) -o $@ $^
$(SWIFTC) $(patsubst -g,,$(SWIFTFLAGS)) -toolchain-stdlib-rpath \
-emit-library $(DYLIB_SWIFT_FLAGS) -o $@ $^
endif
ifneq "$(CODESIGN)" ""
$(CODESIGN) -s - "$(DYLIB_FILENAME)"
Expand Down
12 changes: 5 additions & 7 deletions lldb/test/API/lang/swift/expression/objc_context/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
SWIFT_OBJC_INTEROP := 1
OBJC_SOURCES := main.m
CFLAGS_EXTRAS = $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(BUILDDIR)
LD_EXTRAS = -lFoo -L$(BUILDDIR)

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

include Makefile.rules
all: libFoo.dylib $(EXE)

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

lib%.dylib: %.swift
$(MAKE) MAKE_DSYM=YES CC=$(CC) SWIFTC=$(SWIFTC) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import lldbsuite.test.lldbutil as lldbutil
import os
import unittest2
import shutil

class TestSwiftExpressionObjCContext(TestBase):

Expand All @@ -29,20 +28,12 @@ def setUp(self):
@swiftTest
def test(self):
self.build()
exe_name = "a.out"
exe = self.getBuildArtifact(exe_name)

# Create the target
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)

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

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


if __name__ == '__main__':
import atexit
lldb.SBDebugger.Initialize()
atexit.register(lldb.SBDebugger.Terminate)
unittest2.main()