Add support for Swift Package Manager #1032

Closed
salling wants to merge 17 commits from swiftpm into main
3 changed files with 54 additions and 0 deletions
Showing only changes of commit ad32aee26b - Show all commits

View File

@@ -19,7 +19,7 @@ let package = Package(
name: "yoga",
dependencies: [],
path: "./yoga",
publicHeadersPath: "./apple-public",
publicHeadersPath: "./swiftpm-support",
cxxSettings: [
.headerSearchPath("../"),
],

View File

@@ -33,6 +33,7 @@ Pod::Spec.new do |spec|
'-fPIC'
]
spec.source_files = 'yoga/**/*.{c,h,cpp}'
spec.public_header_files = 'yoga/apple-public/umbrella.h'
spec.exclude_files = 'yoga/swiftpm-support/*.h'
spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGNode,YGStyle,YGValue}.h'
end

View File

@@ -8,6 +8,7 @@
#pragma once
#ifdef __OBJC__
clausjoergensen commented 2020-10-09 06:46:12 -07:00 (Migrated from github.com)
Review

Is it possible to use the SWIFT_PACKAGE preprocessor flag here to make it even safer?

Is it possible to use the [SWIFT_PACKAGE](https://github.com/apple/swift-package-manager/blob/main/Documentation/Usage.md#packaging-legacy-code) preprocessor flag here to make it even safer?
salling commented 2020-10-09 13:12:45 -07:00 (Migrated from github.com)
Review

Does not seem to be defined at the time the public header is compiled. Only when the code that's part of the package is built.

Does not seem to be defined at the time the public header is compiled. Only when the code that's part of the package is built.
#import <Foundation/Foundation.h>
#include "../YGEnums.h"
@@ -16,4 +17,5 @@
#include "../YGStyle.h"
#include "../YGValue.h"
#include "../Yoga.h"
#endif