Add support for Swift Package Manager #1032

Closed
salling wants to merge 17 commits from swiftpm into main
9 changed files with 60 additions and 1 deletions
Showing only changes of commit 64be0d569c - Show all commits

View File

@@ -11,6 +11,7 @@ let package = Package(
products: [ products: [
.library( .library(
name: "yoga", name: "yoga",
type: .dynamic,
targets: ["yoga"] targets: ["yoga"]
), ),
], ],
@@ -30,8 +31,12 @@ let package = Package(
// "-std=c++1y", // "-std=c++1y",
// "-fPIC", // "-fPIC",
// ]) // ])
],
cipolleschi commented 2023-06-15 18:00:46 -07:00 (Migrated from github.com)
Review

this should probably be .cxx17, as this is the version we are typically using internally.

this should probably be `.cxx17`, as this is the version we are typically using internally.
NickGerleman commented 2023-06-16 13:39:44 -07:00 (Migrated from github.com)
Review

Yoga is targeting C++14 for a little bit longer. There was some unhappiness when I tried to bump from C++ 11 directly to 17.

LLVM has had C++ 17 support for almost six years though, so I do plan for us to do a bump later this year. Same rules for same infra, and unlocking more support.

See https://github.com/facebook/yoga/pull/1203 for discussion

Yoga is targeting C++14 for a little bit longer. There was some unhappiness when I tried to bump from C++ 11 directly to 17. LLVM has had C++ 17 support for almost six years though, so I do plan for us to do a bump later this year. Same rules for same infra, and unlocking more support. See https://github.com/facebook/yoga/pull/1203 for discussion
linkerSettings: [
.linkedFramework("Foundation"),
.linkedFramework("UIKit", .when(platforms: [.iOS])),
] ]
) )
], ],
cxxLanguageStandard: .cxx11 cxxLanguageStandard: .cxx14
) )

View File

@@ -7,6 +7,16 @@
#pragma once #pragma once
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif
#ifdef __cplusplus #ifdef __cplusplus
#define YG_EXTERN_C_BEGIN extern "C" { #define YG_EXTERN_C_BEGIN extern "C" {
#define YG_EXTERN_C_END } #define YG_EXTERN_C_END }