Skip to content

Commit 31b17a3

Browse files
committed
Add ldflags for Windows
1 parent 77c7a5f commit 31b17a3

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: src/main/scala/ai/kien/python/Python.scala

+8-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,14 @@ class Python private[python] (
7878
*
7979
* `pythonX.Y-config --ldflags --embed` for `python` 3.8+
8080
*/
81-
lazy val ldflags: Try[Seq[String]] = for {
81+
lazy val ldflags: Try[Seq[String]] = if (isWin) ldflagsWin else ldflagsNix
82+
83+
lazy val ldflagsWin = for {
84+
nativeLibraryPaths <- nativeLibraryPaths
85+
nativeLibrary <- nativeLibrary
86+
} yield ("-l" + nativeLibrary) +: nativeLibraryPaths.map("-L" + _)
87+
88+
lazy val ldflagsNix: Try[Seq[String]] = for {
8289
rawLdflags <- rawLdflags
8390
nativeLibraryPaths <- nativeLibraryPaths
8491
libPathFlags = nativeLibraryPaths.map("-L" + _)

0 commit comments

Comments
 (0)