Skip to content

Commit c7d5039

Browse files
committed
build: disable POSIX mutexes on Windows
Conditionalize the define to use POSIX mutexes to macOS and Linux targets. This would be easier to define as non-POSIX, but the package description does not have the negative check nor a POSIX check. This requires bumping the tools version to 5.3 to gain access to Windows.
1 parent e093926 commit c7d5039

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Package.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.3
22

33
import PackageDescription
44

@@ -72,7 +72,9 @@ let package = Package(
7272
dependencies: ["IndexStoreDB_Core"],
7373
path: "lib/Database",
7474
cSettings: [
75-
.define("MDB_USE_POSIX_MUTEX", to: "1"),
75+
.define("MDB_USE_POSIX_MUTEX", to: "1",
76+
// Windows does not use POSIX mutex
77+
.when(platforms: [.linux, .macOS])),
7678
.define("MDB_USE_ROBUST", to: "0"),
7779
]),
7880

0 commit comments

Comments
 (0)