Skip to content

Commit

Permalink
dpp: add config for voice support (#1596)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Bricklou authored Nov 4, 2022
1 parent baba3ee commit 91df5a3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/d/dpp/port/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 8 additions & 1 deletion packages/d/dpp/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit 91df5a3

Please sign in to comment.