Fixed wrapper module rebuild dependencies on the Makefile file in the HelloPlaydate example target.

This commit is contained in:
2026-07-25 10:29:30 +02:00
parent 1d9504c225
commit 6594794cec
4 changed files with 79 additions and 6 deletions
@@ -0,0 +1,66 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "2700"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "pdex"
BuildableName = "pdex"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
queueDebuggingEnabled = "No">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "pdex"
BuildableName = "pdex"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
+9 -4
View File
@@ -12,15 +12,20 @@ build/Modules/playdate_simulator.o: $(REPO_ROOT)/Sources/PlayDate/*.swift
$(SWIFT_EXEC) $(SWIFT_FLAGS) $(SWIFT_FLAGS_SIMULATOR) -c $^ -emit-module -o $@
# MARK: - Build Game Swift Object
build/game_device.o: Sources/HelloPlaydate/*.swift | build/Modules/playdate_device.o
$(SWIFT_EXEC) $(SWIFT_FLAGS) $(SWIFT_FLAGS_DEVICE) -c $^ -o $@
# The wrapper module is a normal prerequisite so wrapper edits also rebuild
# the game object; only the Swift sources are compiler inputs.
build/game_device.o: Sources/HelloPlaydate/*.swift build/Modules/playdate_device.o
$(SWIFT_EXEC) $(SWIFT_FLAGS) $(SWIFT_FLAGS_DEVICE) -c $(filter %.swift,$^) -o $@
$(OBJDIR)/pdex.elf: build/game_device.o
OBJS += build/game_device.o
# The wrapper object carries symbols that are not emitted into the game
# object, such as the posix_memalign shim the Embedded Swift runtime needs.
# common.mk expanded OBJS before this line, so the link prerequisite has to
# be added explicitly as well.
$(OBJDIR)/pdex.elf: build/Modules/playdate_device.o
OBJS += build/Modules/playdate_device.o
build/game_simulator.o: Sources/HelloPlaydate/*.swift | build/Modules/playdate_simulator.o
$(SWIFT_EXEC) $(SWIFT_FLAGS) $(SWIFT_FLAGS_SIMULATOR) -c $^ -o $@
build/game_simulator.o: Sources/HelloPlaydate/*.swift build/Modules/playdate_simulator.o
$(SWIFT_EXEC) $(SWIFT_FLAGS) $(SWIFT_FLAGS_SIMULATOR) -c $(filter %.swift,$^) -o $@
$(OBJDIR)/pdex.${DYLIB_EXT}: build/game_simulator.o
SIMCOMPILER += build/game_simulator.o
Binary file not shown.
+4 -2
View File
@@ -11,8 +11,10 @@ let package = Package(
),
],
dependencies: [
// Documentation generation only; not linked into the library.
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.4.0"),
.package(
url: "https://github.com/swiftlang/swift-docc-plugin",
from: "1.4.0"
),
],
targets: [
// The Playdate C API headers, resolved through the "playdate"