package An official xmake package repository https://xrepo.xmake.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

add_rules("mode.debug", "mode.release")
DPP: De-const have_voice option and add coroutines support. (#4824) * fix(dpp): Remove repeated have_voice condition * feat(dpp): Make have_voice option modifiable De-const have_voice option and enables optional download of voice libraries * feat(dpp): Add coroutine support Adds a configurable option to enable coroutine support * fix(dpp)!: Change have_voice to voice inside package As mentioned in the same pull request, prefixes like have_ are discouraged in xmake packages. BREAKING CHANGES: This WILL break xmake scripts that use the have_voice flag, IMO it's better to keep the previous have_voice flag as a deprecated alias of the new voice flag, and in the next version of D++ completely remove it from the package. * fix(dpp): Add C++ minimum version for test If coroutines are enabled, C++20 is required or the compilation will fail even though the test only requires C++17 to work, as dpp automatically includes coroutines if the macro is defined without checking C++ version * fix(dpp): Set C++ language for library dinamically The current configuration wasn't proper and when coroutines were enabled, the C++ version would change to C++17 sporadically, ignoring the later C++20 specification that was done later. Now the C++ version will adjust correctly to the coro flag. * style(dpp): Remove requested empty lines * feat(dpp): Re-add have_voice flag with deprecated warning This will bring up again have_voice to avoid codebase breakage, but with many deprecation warnings around to prevent new users to define it.
4 months ago
add_requires("fmt", "nlohmann_json", "openssl", "zlib")
option("coro", {default = false})
option("voice", {default = true})
if has_config("voice") then
add_requires("libopus", "libsodium")
end
target("dpp")
set_kind("$(kind)")
add_includedirs("include", "include/dpp")
add_headerfiles("include/(dpp/**.h)")
add_files("src/dpp/**.cpp")
DPP: De-const have_voice option and add coroutines support. (#4824) * fix(dpp): Remove repeated have_voice condition * feat(dpp): Make have_voice option modifiable De-const have_voice option and enables optional download of voice libraries * feat(dpp): Add coroutine support Adds a configurable option to enable coroutine support * fix(dpp)!: Change have_voice to voice inside package As mentioned in the same pull request, prefixes like have_ are discouraged in xmake packages. BREAKING CHANGES: This WILL break xmake scripts that use the have_voice flag, IMO it's better to keep the previous have_voice flag as a deprecated alias of the new voice flag, and in the next version of D++ completely remove it from the package. * fix(dpp): Add C++ minimum version for test If coroutines are enabled, C++20 is required or the compilation will fail even though the test only requires C++17 to work, as dpp automatically includes coroutines if the macro is defined without checking C++ version * fix(dpp): Set C++ language for library dinamically The current configuration wasn't proper and when coroutines were enabled, the C++ version would change to C++17 sporadically, ignoring the later C++20 specification that was done later. Now the C++ version will adjust correctly to the coro flag. * style(dpp): Remove requested empty lines * feat(dpp): Re-add have_voice flag with deprecated warning This will bring up again have_voice to avoid codebase breakage, but with many deprecation warnings around to prevent new users to define it.
4 months ago
add_packages("fmt", "nlohmann_json", "openssl", "zlib")
if has_config("voice") then
add_packages("libopus", "libsodium")
add_defines("HAVE_VOICE")
end
if has_config("coro") then
add_defines("DPP_CORO")
end
local target_cpp_lang = "c++17"
if has_config("coro") then
target_cpp_lang = "c++20"
end
set_languages(target_cpp_lang)
add_defines("DPP_BUILD", "DPP_USE_EXTERNAL_JSON")
if is_plat("windows", "mingw") then
add_defines("WIN32", "_WINSOCK_DEPRECATED_NO_WARNINGS", "WIN32_LEAN_AND_MEAN")
add_defines("_CRT_SECURE_NO_WARNINGS", "_CRT_NONSTDC_NO_DEPRECATE")
add_defines("FD_SETSIZE=1024")
if is_plat("windows") then
add_cxflags("/Zc:preprocessor")
end
if is_kind("static") then
add_defines("DPP_STATIC", {public = true})
end
end