OpenFoundation

main

The package provides CF-like macro for cross-platform SwiftPM C target.
OpenSwiftUIProject/OpenFoundation

Caution

This package is deprecated.

See OpenSwiftUIProject/OpenGraph#17 and OpenSwiftUIProject/OpenSwiftUI#36

OpenFoundation

The package provides CF-like macro for cross-platform SwiftPM C target.

You can only import CoreFoundation on C target in Darwin platform.

Usage

First add the dependency in your Package.swift and add coresponding Clang flag.

let package = Package(
    name: "DemoKit",
    products: [
        .library(name: "DemoKit", targets: ["DemoKit"]),
    ],
    dependencies: [
        .package(url: "https://github.com/OpenSwiftUIProject/OpenFoundation", from: "0.0.1"),
    ],
    targets: [
        .target(
            name: "DemoKit",
            dependencies: [
                .product(name: "OpenFoundation", package: "OpenFoundation")
            ],
            // Upstream issue llvm/llvm-project#48757
            cSettings: [
                .unsafeFlags(["-Wno-elaborated-enum-base"]),
            ]
        ),
    ]
)

Then in your C code, you can include OpenFoundation/OpenFoundation.h on non-Darwin platform.

#include <OpenFoundation/OpenFoundation.h>

License

Most of the code is from apple/swift-corelibs-foundation with small modification.

This repo is released under the Apache license. See LICENSE for details.

Acknowledgements

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Oct 19 2024 18:27:07 GMT-0900 (Hawaii-Aleutian Daylight Time)