Skip to content

Commit 25df0ec

Browse files
committed
build: adjust the linker flags for JavaKit
`-rpath` is not a universally valid flag for the linker. Adjust the linker flags to add the library search path on Windows and elide the `-rpath` flag. It is unclear why there is no `server` subdirectory under `lib` when using the Oracle JDK 23, but this allows us to find the necessary library.
1 parent 79237aa commit 25df0ec

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Package.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,10 @@ let package = Package(
174174
"-rpath",
175175
"-Xlinker",
176176
"\(javaHome)/lib/server",
177-
]
177+
],
178+
.when(platforms: [.linux, .macOS])
178179
),
180+
.unsafeFlags(["-L\(javaHome)/lib"], .when(platforms: [.windows])),
179181
.linkedLibrary("jvm"),
180182
]
181183
),

0 commit comments

Comments
 (0)