From 759b7f3afbabe297b8ee64c9aa283b29842bd626 Mon Sep 17 00:00:00 2001 From: Marc Prud'hommeaux Date: Wed, 16 Sep 2026 11:59:29 -0400 Subject: [PATCH] Add SKIP_DYNAMIC_LIBRARIES check in Package.swift to force .dynamic product type --- Package.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Package.swift b/Package.swift index 4912fbc..911d713 100644 --- a/Package.swift +++ b/Package.swift @@ -17,7 +17,12 @@ let package = Package( ] ) -if Context.environment["SKIP_BRIDGE"] ?? "0" != "0" { +// SKIP_DYNAMIC_LIBRARIES and SKIP_BRIDGE both enforce building as dynamic +// libraries; SKIP_BRIDGE additionally puts the skipstone plugin in bridge mode +let bridgeMode = (Context.environment["SKIP_BRIDGE"] ?? "0") != "0" +let forceDylib = bridgeMode || (Context.environment["SKIP_DYNAMIC_LIBRARIES"] ?? "0") != "0" + +if forceDylib { // all library types must be dynamic to support bridging package.products = package.products.map({ product in guard let libraryProduct = product as? Product.Library else { return product }