Skip to content

Commit

Permalink
log4cplus: support more platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing committed Nov 6, 2024
1 parent ec54dea commit 5656a2b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions packages/l/log4cplus/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package("log4cplus")

set_homepage("https://sourceforge.net/projects/log4cplus/")
set_description("log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration.")
set_license("BSD-2-Clause")
Expand All @@ -12,24 +11,25 @@ package("log4cplus")

add_configs("unicode", {description = "Use unicode charset.", default = true, type = "boolean"})

add_deps("cmake")
if is_plat("windows") then
if is_plat("windows", "mingw") then
add_syslinks("advapi32", "ws2_32")
elseif is_plat("linux") then
elseif is_plat("linux", "bsd") then
add_syslinks("pthread")
end

on_load("windows", "linux", "macosx", function (package)
add_deps("cmake")

on_load(function (package)
if package:config("unicode") then
package:add("defines", "UNICODE")
end
end)

on_install("windows", "linux", "macosx", function (package)
local configs = {"-DLOG4CPLUS_BUILD_TESTING=OFF"}
table.insert(configs, "-DUNICODE=" .. (package:config("unicode") and "ON" or "OFF"))
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
on_install(function (package)
local configs = {"-DLOG4CPLUS_BUILD_TESTING=OFF", "-DWITH_UNIT_TESTS=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DUNICODE=" .. (package:config("unicode") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)

Expand Down

0 comments on commit 5656a2b

Please sign in to comment.