Explorar el Código

libgpiod: fix cxx bindings not having c links (#2991)

Chi Huu Huynh hace 1 año
padre
commit
393436a2b4
Se han modificado 1 ficheros con 11 adiciones y 1 borrados
  1. 11 1
      packages/l/libgpiod/port/xmake.lua

+ 11 - 1
packages/l/libgpiod/port/xmake.lua

@@ -22,13 +22,23 @@ if has_config("enable_bindings_cxx") then
         set_kind("$(kind)")
         set_languages("cxx17")
 
+        add_headerfiles("include/(gpiod.h)")
+        add_headerfiles("lib/uapi/*.h")
+        add_files("lib/*.c")
+        
+        add_includedirs("include")
+
         add_headerfiles("bindings/cxx/(gpiod.hpp)")
         add_headerfiles("bindings/cxx/(gpiodcxx/**.hpp)")
         add_files("bindings/cxx/*.cpp")
 
         add_includedirs("bindings/cxx", {public = true})
 
-        add_deps("gpiod")
+        before_build(function (target)
+            local configure = io.readfile("configure.ac")
+            local version = configure:match("AC_INIT%(%[libgpiod%], %[?([0-9%.]+)%]?%)")
+            target:add("defines", "GPIOD_VERSION_STR=\"" .. version .. "\"")
+        end)
 end
 
 if has_config("enable_tools") then