Skip to content

Commit

Permalink
msgpack-cxx: add set_kind("library", {headeronly = true})
Browse files Browse the repository at this point in the history
  • Loading branch information
Chi-EEE committed Jul 14, 2024
1 parent 33bc7cc commit 8803174
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/m/msgpack-cxx/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package("msgpack-cxx")
set_kind("library", {headeronly = true})
set_homepage("https://msgpack.org/")
set_description("MessagePack implementation for C++")
set_license("BSL-1.0")
Expand All @@ -10,12 +11,13 @@ package("msgpack-cxx")

add_configs("header_only", {description = "Use header only version.", default = false, type = "boolean"})
add_configs("std", {description = "Choose C++ standard version.", default = "cxx17", type = "string", values = {"cxx98", "cxx11", "cxx14", "cxx17", "cxx20"}})
add_configs("boost", {description = "Use Boost", default = false, type = "boolean"})
add_configs("boost", {description = "Use Boost", default = true, type = "boolean"})

on_load(function (package)
if package:config("header_only") then
package:set("kind", "library", {headeronly = true})
else
if not package:config("header_only") then
package:add("deps", "cmake")
end
if package:config("boost") then
Expand All @@ -38,9 +40,6 @@ package("msgpack-cxx")
if package:config("boost") then
table.insert(configs, "-DMSGPACK_USE_STATIC_BOOST=ON")
table.insert(configs, "-DMSGPACK_USE_BOOST=ON")
if is_plat("windows") then
table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
end
else
table.insert(configs, "-DMSGPACK_USE_BOOST=OFF")
end
Expand Down

0 comments on commit 8803174

Please sign in to comment.