Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion packages/l/libhv/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package("libhv")
set_license("BSD-3-Clause")

add_urls("https://github.com/ithewei/libhv.git")
add_urls("https://github.com/ithewei/libhv/archive/refs/$(version).zip", {excludes = {"*/html/*"}})
add_urls("https://github.com/ithewei/libhv/archive/refs/tags/$(version).zip", {excludes = {"*/html/*"}})

add_versions("v1.0.0", "39adb77cc7addaba82b69fa9a433041c8288f3d9c773fa360162e3391dcf6a7b")
add_versions("v1.1.0", "a753c268976d9c4f85dcc10be2377bebc36d4cb822ac30345cf13f2a7285dbe3")
Expand All @@ -18,6 +18,7 @@ package("libhv")
add_versions("v1.3.1", "66fb17738bc51bee424b6ddb1e3b648091fafa80c8da6d75626d12b4188e0bdc")
add_versions("v1.3.2", "61d6d5fadf13d81c111df4514e0e61062fead21c2a8b6c4caf7706f9b002fae1")
add_versions("v1.3.3", "f78d1012ddf82506c28dda573ce303912e6cd5e707a358a249db1cc7e1e82238")
add_versions("v1.3.4", "966866873897ff4a7c526c3f6f1d00d7c13027aa5eef16270a5c5b4094dbdf95")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While adding the new version at the end of the list is functionally correct, for better maintainability and consistency across the repository, it's recommended to add new versions at the top of the add_versions block, keeping the list in descending order. This makes it easier for future maintainers to quickly identify the latest version.


add_configs("protocol", {description = "compile protocol", default = false, type = "boolean"})
add_configs("http", {description = "compile http", default = true, type = "boolean"})
Expand Down Expand Up @@ -78,6 +79,18 @@ target_link_libraries(hv ${LIBS} nlohmann_json::nlohmann_json)]], {plain = true}
io.replace("CMakeLists.txt", [[target_link_libraries(hv_static ${LIBS})]],
[[find_package(nlohmann_json CONFIG REQUIRED)
target_link_libraries(hv_static ${LIBS} nlohmann_json::nlohmann_json)]], {plain = true})

-- Fix PDB file installation issue for Windows static library builds
io.replace("CMakeLists.txt",
[[if(WIN32 AND NOT MINGW)
install(FILES $<TARGET_PDB_FILE:${PROJECT_NAME}> DESTINATION bin OPTIONAL)
endif()]],
[[if(WIN32 AND NOT MINGW)
if(BUILD_SHARED)
install(FILES $<TARGET_PDB_FILE:hv> DESTINATION bin OPTIONAL)
endif()
endif()]], {plain = true})

for _, suffix in ipairs({"**.h", "**.cpp"}) do
for _, file in ipairs(os.files(suffix)) do
io.replace(file, [[#include "json.hpp"]], [[#include <nlohmann/json.hpp>]], {plain = true})
Expand Down
Loading