Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for direct CASAPI access from libToolchainCASPlugin.dylib #1415

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,18 @@ let package = Package(
.target(name: "CSwiftScan",
exclude: [ "CMakeLists.txt" ]),

/// C modules wrapper for ToolchainCASPlugin.
.target(name: "CToolchainCASPlugin",
exclude: [ "CMakeLists.txt" ]),

/// The driver library.
.target(
name: "SwiftDriver",
dependencies: [
"SwiftOptions",
.product(name: "SwiftToolsSupport-auto", package: "swift-tools-support-core"),
"CSwiftScan",
"CToolchainCASPlugin",
.product(name: "Yams", package: "yams"),
],
exclude: ["CMakeLists.txt"]),
Expand Down
1 change: 1 addition & 0 deletions Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors

add_subdirectory(CSwiftScan)
add_subdirectory(CToolchainCASPlugin)
add_subdirectory(SwiftOptions)
add_subdirectory(SwiftDriver)
add_subdirectory(SwiftDriverExecution)
Expand Down
5 changes: 5 additions & 0 deletions Sources/CSwiftScan/include/swiftscan_header.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ typedef struct {

//=== Scanner CAS Operations ----------------------------------------------===//
swiftscan_cas_t (*swiftscan_cas_create)(const char *path);
swiftscan_cas_t (*swiftscan_cas_create_from_plugin)(const char *plugin_path,
const char *ondisk_path,
int argc,
const char **keys,
const char **values);
void (*swiftscan_cas_dispose)(swiftscan_cas_t cas);
swiftscan_string_ref_t (*swiftscan_cas_store)(swiftscan_cas_t cas,
uint8_t *data, unsigned size);
Expand Down
10 changes: 10 additions & 0 deletions Sources/CToolchainCASPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2020 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://swift.org/LICENSE.txt for license information
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors

add_library(CToolchainCASPlugin STATIC
ToolchainCASPluginImpl.c)
3 changes: 3 additions & 0 deletions Sources/CToolchainCASPlugin/ToolchainCASPluginImpl.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// This file is here to prevent the package manager from warning about a
// target with no sources.
#include "include/ToolchainCASPlugin_CAPI.h"
Loading