diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..c7e08a94 --- /dev/null +++ b/Package.swift @@ -0,0 +1,35 @@ +// swift-tools-version:5.3 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "yoga", + platforms: [ + .iOS(.v9), + .macOS(.v10_10), + .watchOS(.v2), + .tvOS(.v10), + ], + products: [ + .library( + name: "yoga", + targets: ["yoga"] + ), + ], + targets: [ + .target( + name: "yoga", + dependencies: [], + path: "./yoga", + publicHeadersPath: "./swiftpm-support", + cxxSettings: [ + .headerSearchPath("../"), + ], + linkerSettings: [ + .linkedFramework("Foundation"), + ] + ) + ], + cxxLanguageStandard: .cxx14 +) diff --git a/Yoga.podspec b/Yoga.podspec index 2b09977d..c692c448 100644 --- a/Yoga.podspec +++ b/Yoga.podspec @@ -33,6 +33,7 @@ Pod::Spec.new do |spec| '-fPIC' ] spec.source_files = 'yoga/**/*.{c,h,cpp}' + spec.exclude_files = 'yoga/swiftpm-support/*.h' spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGNode,YGStyle,YGValue}.h' end diff --git a/yoga/swiftpm-support/umbrella.h b/yoga/swiftpm-support/umbrella.h new file mode 100644 index 00000000..c674ceb8 --- /dev/null +++ b/yoga/swiftpm-support/umbrella.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#pragma once + +#ifdef __OBJC__ + +#import + +#include "../YGEnums.h" +#include "../YGMacros.h" +#include "../YGNode.h" +#include "../YGStyle.h" +#include "../YGValue.h" +#include "../Yoga.h" + +#endif