From dd4d4e29230b4829f18b074d8260fdda7fabc1ea Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 13 Feb 2025 13:55:51 -0800 Subject: [PATCH] Add SwiftPM package to build dependencies for iOS (#49361) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49361 This change adds the Package.swift file that we will use to build the dependencies for React Native ## Changelog: [Internal] - Swift PM file to build ReactNativeDependencies Reviewed By: cortinico Differential Revision: D69518776 fbshipit-source-id: 85006c3c5933cc6a5fd772f7b014a823d7bb99b3 --- .../react-native/third-party/Package.swift | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 packages/react-native/third-party/Package.swift diff --git a/packages/react-native/third-party/Package.swift b/packages/react-native/third-party/Package.swift new file mode 100644 index 00000000000..0355896eee0 --- /dev/null +++ b/packages/react-native/third-party/Package.swift @@ -0,0 +1,42 @@ +// swift-tools-version: 6.0 +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import PackageDescription + +let glogUnsafeCAndCxxFlags = ["-Wno-shorten-64-to-32"] + +let package = Package( + name: "ReactNativeDependencies", + products: [ + // Products define the executables and libraries a package produces, making them visible to other packages. + .library( + name: "ReactNativeDependencies", + type: .dynamic, + targets: ["glog"] + ), + ], + targets: [ + // Targets are the basic building blocks of a package, defining a module or a test suite. + // Targets can depend on other targets in this package and products from dependencies. + .target( + name: "glog", + dependencies: [], + path: "glog", +// resources: [.copy("../third-party-podspecs/glog/PrivacyInfo.xcprivacy")], + publicHeadersPath: "./src", + cSettings: [ + .headerSearchPath("src"), + .unsafeFlags(glogUnsafeCAndCxxFlags) + ], + cxxSettings: [ + .headerSearchPath("src"), + .unsafeFlags(glogUnsafeCAndCxxFlags) + ] + ), + ] +)