Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

OpenSwiftUIProject/OpenFoundation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published