set_project("brpc")
set_version("0.0.1", {build = "%Y%m%d%H%M"})
set_xmakever("2.8.5")

add_repositories("my_private_repo https://github.com/fantasy-peak/xmake-repo.git")

add_requires("boost", {configs={cmake=false}})
add_requires("spdlog")
add_requires("asio", "nlohmann_json")
add_requires("cppzmq", {system = false})
add_requires("msgpack-cxx", {system = false, configs={boost=false}})

set_policy("check.auto_ignore_flags", false)
add_cxflags("-O2 -Wall -Wextra -pedantic-errors -Wno-missing-field-initializers -Wno-ignored-qualifiers")
add_includedirs("./out/include")

target("bi")
    set_languages("c++17")
    set_kind("binary")
    add_files("test/cpp/bi.cpp")
    add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio")
    add_syslinks("pthread", "uuid")
target_end()

target("coro_bi")
    set_languages("c++20")
    set_kind("binary")
    add_files("test/cpp/coro_bi.cpp")
    add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio", "boost")
    add_syslinks("pthread", "uuid")
target_end()

target("coro_frpc_bi")
    set_languages("c++20")
    set_kind("binary")
    add_files("test/cpp/coro_frpc_bi.cpp")
    add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio")
    add_syslinks("pthread", "uuid")
target_end()

target("uni_pub_sub")
    set_languages("c++17")
    set_kind("binary")
    add_files("test/cpp/uni_pub_sub.cpp")
    add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio")
    add_syslinks("pthread", "uuid")
target_end()

target("coro_uni_pub_sub")
    set_languages("c++20")
    set_kind("binary")
    add_files("test/cpp/uni_pub_sub.cpp")
    add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio")
    add_syslinks("pthread", "uuid")
target_end()

target("uni_push_pull")
    set_languages("c++17")
    set_kind("binary")
    add_files("test/cpp/uni_push_pull.cpp")
    add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio")
    add_syslinks("pthread", "uuid")
target_end()

target("coro_uni_push_pull")
    set_languages("c++20")
    set_kind("binary")
    add_files("test/cpp/uni_push_pull.cpp")
    add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio")
    add_syslinks("pthread", "uuid")
target_end()

target("coro_bi_stream")
    set_languages("c++20")
    set_kind("binary")
    add_files("test/cpp/bi_stream.cpp")
    add_packages("msgpack-cxx", "nlohmann_json", "cppzmq", "spdlog", "asio")
    add_syslinks("pthread", "uuid")
target_end()
