diff --git a/.github/workflows/validate-swiftpm.yml b/.github/workflows/validate-swiftpm.yml new file mode 100644 index 00000000..da582708 --- /dev/null +++ b/.github/workflows/validate-swiftpm.yml @@ -0,0 +1,22 @@ +name: Swift + +on: + pull_request: + push: + branches: + - main + workflow_dispatch: + +jobs: + test: + name: Build + runs-on: macos-latest + + steps: + - uses: actions/checkout@v3 + + - name: Build Debug + run: swift build -c debug + + - name: Build Release + run: swift build -c release diff --git a/Package.swift b/Package.swift new file mode 100644 index 00000000..4c8d846f --- /dev/null +++ b/Package.swift @@ -0,0 +1,32 @@ +// swift-tools-version:5.0 +// The swift-tools-version declares the minimum version of Swift required to build this package. +/* + * 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 package = Package( + name: "yoga", + products: [ + .library(name: "yoga", targets: [ "core" ]) + ], + targets: [ + .target( + name: "core", + path: ".", + sources: [ + "yoga" + ], + publicHeadersPath: ".", + cxxSettings: [ + .headerSearchPath(".") + ] + ) + ], + cxxLanguageStandard: CXXLanguageStandard(rawValue: "c++17") +) diff --git a/yoga/module.modulemap b/yoga/module.modulemap new file mode 100644 index 00000000..91c6db29 --- /dev/null +++ b/yoga/module.modulemap @@ -0,0 +1,16 @@ +/* + * 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. + */ + +module yoga [system] { + module core { + header "YGEnums.h" + header "YGMacros.h" + header "YGValue.h" + header "Yoga.h" + export * + } +}