Skip to content
Open
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
16 changes: 15 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,11 @@ let package = Package(
"crypto/x509/x_val.cc",
"crypto/x509/x_x509.cc",
"crypto/x509/x_x509a.cc",
"err_data.c",
// Not err_data.c: crypto/err/err.cc (C++) declares these tables
// without extern "C", which on Windows gives their C++ names a
// different mangling from their C ones. gen/crypto/err_data.cc is
// the same tables in C++.
"gen/crypto/err_data.cc",
"ssl/bio_ssl.cc",
"ssl/d1_both.cc",
"ssl/d1_lib.cc",
Expand Down Expand Up @@ -315,6 +319,16 @@ let package = Package(

cSettings: [
.define("OPENSSL_NO_ASM", to: "1"),
// As swift-nio-ssl's copy of BoringSSL: windows.h includes
// winsock.h, which clashes with winsock2.h, unless _WINSOCKAPI_ is
// defined.
.define("_WINSOCKAPI_", .when(platforms: [.windows])),
.define("NOMINMAX", .when(platforms: [.windows])),
.define("NOCRYPT", .when(platforms: [.windows])),
// Windows only: the thread-exit callback isn't prefixed, so it would
// clash with the one in other copies of BoringSSL (swift-crypto's)
// in the same binary. thread_win.cc allows it to be a macro.
.define("p_thread_callback_boringssl", to: "p_thread_callback_boringssl_grpc", .when(platforms: [.windows])),
.headerSearchPath("./"),
.headerSearchPath("include/"),
]
Expand Down