Skip to content

Commit

Permalink
figure out webkit version and link accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
drkameleon committed Jan 30, 2025
1 parent bf38a59 commit 573ae09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/extras/webview.nim
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ import extras/window

when defined(linux):
{.compile("webview/webview-unix.cc","-std=c++11").}
let webkit_version = staticExec("pkg-config --modversion webkit2gtk-4.1 2>/dev/null || echo 4.0")
{.passC: "-DWEBVIEW_GTK=1 -DWEBVIEW_STATIC=1 " &
staticExec"pkg-config --cflags gtk+-3.0 webkit2gtk-4.0".}
staticExec"pkg-config --cflags gtk+-3.0 webkit2gtk-" & webkit_version.}
{.passL: "-lstdc++ " &
staticExec"pkg-config --libs gtk+-3.0 webkit2gtk-4.0".}
staticExec"pkg-config --libs gtk+-3.0 webkit2gtk-" & webkit_version.}
elif defined(freebsd) or defined(netbsd) or defined(openbsd):
{.compile("webview/webview-unix.cc","-std=c++11").}
{.passC: "-DWEBVIEW_GTK=1 " &
Expand Down
7 changes: 4 additions & 3 deletions src/extras/window.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import os
{.passC: "-I" & parentDir(currentSourcePath()) .}

when defined(linux):
{.compile("window/window.cc", staticExec"pkg-config --cflags gtk+-3.0 webkit2gtk-4.0").}
{.passC: staticExec"pkg-config --cflags gtk+-3.0 webkit2gtk-4.0".}
{.passL: staticExec"pkg-config --libs gtk+-3.0 webkit2gtk-4.0".}
let webkit_version = staticExec("pkg-config --modversion webkit2gtk-4.1 2>/dev/null || echo 4.0")
{.compile("window/window.cc", staticExec"pkg-config --cflags gtk+-3.0 webkit2gtk-" & webkit_version).}
{.passC: staticExec"pkg-config --cflags gtk+-3.0 webkit2gtk-" & webkit_version .}
{.passL: staticExec"pkg-config --libs gtk+-3.0 webkit2gtk-" & webkit_version .}
elif defined(freebsd) or defined(netbsd) or defined(openbsd):
{.compile("window/window.cc", staticExec"pkg-config --cflags gtk3 webkit2-gtk3").}
{.passC: staticExec"pkg-config --cflags gtk3 webkit2-gtk3".}
Expand Down

0 comments on commit 573ae09

Please sign in to comment.