Skip to content

Commit e71ca65

Browse files
committed
Set up a client-side C library to talk with C APIs exposed from the compiler
We could use functions like dlopen and dlsym in this client-side library to talk with compiler-side C APIs.
1 parent cf36366 commit e71ca65

File tree

5 files changed

+10
-1
lines changed

5 files changed

+10
-1
lines changed

Package.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ let package = Package(
3636
targets: ["SwiftDriverExecution"]),
3737
],
3838
targets: [
39+
.target(name: "_CSwiftDriver"),
40+
3941
/// The driver library.
4042
.target(
4143
name: "SwiftDriver",
42-
dependencies: ["SwiftOptions", "SwiftToolsSupport-auto", "Yams"]),
44+
dependencies: ["SwiftOptions", "SwiftToolsSupport-auto", "Yams", "_CSwiftDriver"]),
4345

4446
/// The execution library.
4547
.target(

Sources/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# See http://swift.org/LICENSE.txt for license information
77
# See http://swift.org/CONTRIBUTORS.txt for Swift project authors
88

9+
add_subdirectory(_CSwiftDriver/src)
910
add_subdirectory(SwiftOptions)
1011
add_subdirectory(SwiftDriver)
1112
add_subdirectory(SwiftDriverExecution)

Sources/SwiftDriver/Driver/Driver.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import TSCBasic
1313
import TSCUtility
1414
import Foundation
1515
import SwiftOptions
16+
import _CSwiftDriver
1617

1718
/// The Swift driver.
1819
public struct Driver {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
void dummyfunction();
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#include "_CSwiftDriver.h"
2+
#include <dlfcn.h>
3+
4+
void dummyfunction() {};

0 commit comments

Comments
 (0)