Ver Fonte

improve wxwidget for gtk3

ruki há 2 anos atrás
pai
commit
8450c503dc
2 ficheiros alterados com 14 adições e 1 exclusões
  1. 1 1
      .github/workflows/ubuntu.yml
  2. 13 0
      packages/w/wxwidgets/xmake.lua

+ 1 - 1
.github/workflows/ubuntu.yml

@@ -29,7 +29,7 @@ jobs:
         run: |
           # TODO we will remove it later
           sudo apt-get update
-          sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev p7zip
+          sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev p7zip libgtk-3-dev
           sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 60
           sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60
           sudo update-alternatives --install /usr/bin/cpp cpp /usr/bin/cpp-9 60

+ 13 - 0
packages/w/wxwidgets/xmake.lua

@@ -92,6 +92,19 @@ package("wxwidgets")
             table.insert(configs, "-DwxBUILD_DEBUG_LEVEL=2")
         end
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
+        if package:is_plat("linux") then
+            local gtk = package:dep("gtk+3"):fetch()
+            if gtk then
+                local includedirs = gtk.includedirs or gtk.sysincludedirs
+                if includedirs then
+                    table.insert(configs, "-DGTK3_INCLUDE_DIRS=" .. table.concat(table.wrap(includedirs), ";"))
+                end
+                local links = gtk.links
+                if links then
+                    table.insert(configs, "-DGTK3_LIBRARIES=" .. table.concat(table.wrap(links), ";"))
+                end
+            end
+        end
         import("package.tools.cmake").install(package, configs)
         local version = package:version()
         local subdir = "wx-" .. version:major() .. "." .. version:minor()