Skip to content

Commit

Permalink
Fix Foundation
Browse files Browse the repository at this point in the history
  • Loading branch information
colemancda committed Dec 27, 2024
1 parent 7e3ef72 commit 10aa393
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion external.mk
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include $(sort $(wildcard $(BR2_EXTERNAL_SWIFT_PATH)/package/*/*.mk))
include $(sort $(wildcard $(BR2_EXTERNAL_SWIFT_PATH)/package/*.mk))
include $(sort $(wildcard $(BR2_EXTERNAL_SWIFT_PATH)/package/*/*.mk))
2 changes: 1 addition & 1 deletion package/pkg-swift.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
################################################################################

HOST_SWIFT_SUPPORT_DIR = $(HOST_DIR)/usr/share/swift
SWIFT_BIN = $(HOST_SWIFT_SUPPORT_DIR)/bin/swift
SWIFT_BIN = /usr/bin/swift
SWIFT_DESTINATION_FILE = $(HOST_SWIFT_SUPPORT_DIR)/toolchain.json

################################################################################
Expand Down
2 changes: 1 addition & 1 deletion package/swift-foundation/Config.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
if BR2_PACKAGE_SWIFT

config BR2_PACKAGE_SWIFT_FOUNDATION
bool "foundation"
bool "swift-foundation"
depends on BR2_PACKAGE_SWIFT
select BR2_PACKAGE_LIBSWIFTDISPATCH
select BR2_PACKAGE_LIBCURL
Expand Down
1 change: 1 addition & 0 deletions package/swift-foundation/swift-foundation.mk
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ define SWIFT_FOUNDATION_INSTALL_STAGING_CMDS
echo 'framework module CoreFoundation [extern_c] [system] { umbrella header "${STAGING_DIR}/usr/lib/swift/CoreFoundation/CoreFoundation.h" }' > ${STAGING_DIR}/usr/lib/swift/CoreFoundation/module.map
# Copy Swift modules
cp $(SWIFT_FOUNDATION_BUILDDIR)/swift/* ${STAGING_DIR}/usr/lib/swift/linux/$(SWIFT_TARGET_ARCH)/
cp -rf $(SWIFT_FOUNDATION_BUILDDIR)/_CModulesForClients/* ${STAGING_DIR}/usr/lib/swift/
# Restore Dispatch headers
$(LIBSWIFTDISPATCH_INSTALL_STAGING_CMDS)
endef
Expand Down
3 changes: 2 additions & 1 deletion package/swift-hello/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ if BR2_PACKAGE_SWIFT
config BR2_PACKAGE_SWIFT_HELLO
bool "swift-hello"
depends on BR2_PACKAGE_SWIFT
depends on BR2_PACKAGE_SWIFT_FOUNDATION
select BR2_PACKAGE_SWIFT_FOUNDATION
select BR2_PACKAGE_XCTEST
help
Demo application for Swift.

Expand Down
2 changes: 1 addition & 1 deletion package/swift-hello/src/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.5
// swift-tools-version:6.0
import PackageDescription

let package = Package(
Expand Down
2 changes: 1 addition & 1 deletion package/swift-hello/swift-hello.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SWIFT_HELLO_SITE = $(SWIFT_HELLO_PKGDIR)/src
SWIFT_HELLO_SITE_METHOD = local
SWIFT_HELLO_INSTALL_STAGING = NO
SWIFT_HELLO_INSTALL_TARGET = YES
SWIFT_HELLO_DEPENDENCIES = swift swift-foundation
SWIFT_HELLO_DEPENDENCIES = swift swift-foundation xctest
SWIFT_HELLO_EXECUTABLES = swift-hello

$(eval $(swift-package))
4 changes: 2 additions & 2 deletions package/xctest/xctest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ XCTEST_LICENSE_FILES = LICENSE
XCTEST_INSTALL_STAGING = YES
XCTEST_INSTALL_TARGET = YES
XCTEST_SUPPORTS_IN_SOURCE_BUILD = NO
XCTEST_DEPENDENCIES = swift foundation
XCTEST_DEPENDENCIES = swift swift-foundation

XCTEST_CONF_OPTS += \
-DCMAKE_Swift_FLAGS=${SWIFTC_FLAGS} \
Expand All @@ -15,7 +15,7 @@ XCTEST_CONF_OPTS += \
-DCMAKE_Swift_FLAGS_RELWITHDEBINFO="" \
-DCF_DEPLOYMENT_SWIFT=ON \
-Ddispatch_DIR="$(LIBSWIFTDISPATCH_BUILDDIR)/cmake/modules" \
-DFoundation_DIR="$(FOUNDATION_BUILDDIR)/cmake/modules" \
-DFoundation_DIR="$(SWIFT_FOUNDATION_BUILDDIR)/cmake/modules" \

ifeq (XCTEST_SUPPORTS_IN_SOURCE_BUILD),YES)
XCTEST_BUILDDIR = $(XCTEST_SRCDIR)
Expand Down

0 comments on commit 10aa393

Please sign in to comment.