Bläddra i källkod

dpp: add config for voice support (#1596)

* dpp: add config for voice support

now developers can now enable or disable the voice support on the library

* dpp: moved `have_voice` config and deps

i forgot to move dependencies to add them only if the voice support is enabled

* dpp: fix typo

* dpp: remove the `have_voice` define in port file

since the `have_voice` define is now managed in the package config,
this define doesn't make sense anymore.
Louis Bailleau 2 år sedan
förälder
incheckning
91df5a3e3e
2 ändrade filer med 8 tillägg och 2 borttagningar
  1. 0 1
      packages/d/dpp/port/xmake.lua
  2. 8 1
      packages/d/dpp/xmake.lua

+ 0 - 1
packages/d/dpp/port/xmake.lua

@@ -11,7 +11,6 @@ target("dpp")
     add_packages("fmt", "nlohmann_json", "libsodium", "libopus", "openssl", "zlib")
 
     add_defines("DPP_BUILD")
-    add_defines("HAVE_VOICE")
 
     if is_plat("windows", "mingw") then
         add_defines("WIN32", "_WINSOCK_DEPRECATED_NO_WARNINGS", "WIN32_LEAN_AND_MEAN")

+ 8 - 1
packages/d/dpp/xmake.lua

@@ -51,7 +51,9 @@ package("dpp")
     add_versions("v10.0.8", "7a16d31841fc67fabcafbc33abb1a6b2ac472202df7e8c48542f77e089de08e3")
     add_patches("v10.0.8", path.join(os.scriptdir(), "patches", "v10.0.8", "static_export.patch"), "d18487580faa9af21862bcff30ddfa5d5ab5cda6aa5f779bcc1787a96ca66447")
 
-    add_deps("nlohmann_json", "libsodium", "libopus", "openssl", "zlib")
+    add_deps("nlohmann_json", "openssl", "zlib")
+
+    add_configs("have_voice", { description = "Enable voice support for the library.", default = true, type = "boolean" , readonly = true})
 
     if is_plat("linux", "macosx") then
         add_syslinks("pthread")
@@ -62,6 +64,11 @@ package("dpp")
             package:add("defines", "DPP_STATIC")
         end
 
+        if package:config("have_voice") then
+            package:add("defines", "HAVE_VOICE")
+            package:add("deps", "libsodium", "libopus")
+        end
+
         if package:version():le("v10.0.13") then
             package:add("deps", "fmt")
         end