Skip to content

Commit

Permalink
crc32c: Fix windows shared build
Browse files Browse the repository at this point in the history
  • Loading branch information
star-hengxing authored Jan 16, 2025
1 parent b8fd0ab commit e4febcb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions packages/c/crc32c/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package("crc32c")

set_homepage("https://github.com/google/crc32c")
set_description("CRC32C implementation with support for CPU-specific acceleration instructions")
set_license("BSD-3-Clause")

add_urls("https://github.com/google/crc32c/archive/refs/tags/$(version).tar.gz",
"https://github.com/google/crc32c.git")
Expand All @@ -11,15 +11,13 @@ package("crc32c")
add_deps("cmake")

on_install(function (package)
import("package.tools.cmake")
local configs = {"-DCRC32C_BUILD_TESTS=OFF", "-DCRC32C_BUILD_BENCHMARKS=OFF", "-DCRC32C_USE_GLOG=OFF"}
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
if package:config("shared") then
table.insert(configs, "-DBUILD_SHARED_LIBS=on")
else
table.insert(configs, "-DBUILD_SHARED_LIBS=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"))
if package:is_plat("windows") and package:config("shared") then
table.insert(configs, "-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON")
end
cmake.install(package, configs)
import("package.tools.cmake").install(package, configs)
end)

on_test(function (package)
Expand Down

0 comments on commit e4febcb

Please sign in to comment.