Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-lc: fix mingw build #4625

Merged
merged 2 commits into from
Jul 16, 2024
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
23 changes: 17 additions & 6 deletions packages/a/aws-lc/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@ package("aws-lc")
add_urls("https://github.com/aws/aws-lc/archive/refs/tags/$(version).tar.gz",
"https://github.com/aws/aws-lc.git")

add_versions("v1.31.0", "f2dfe0ef8fe21482b6795da01a1b226f826e9a084833ff8d5371a02f9623c150")
add_versions("v1.32.0", "67fbb78659055c2289c9068bb4ca1c0f1b6ca27700c7f6d34c6bc2f27cd46314")

add_configs("jitter", {description = "Enable FIPS entropy source: CPU Jitter", default = false, type = "boolean"})
add_configs("go", {description = "Enable go", default = false, type = "boolean"})
add_configs("perl", {description = "Enable perl", default = false, type = "boolean"})
add_configs("tools", {description = "Build tools", default = false, type = "boolean"})

add_deps("cmake")
if is_plat("windows") then
if is_plat("windows", "mingw") or is_host("windows") then
add_deps("nasm")
end

Expand All @@ -23,7 +25,16 @@ package("aws-lc")
add_syslinks("pthread", "dl", "m")
end

on_install(function (package)
on_load(function (package)
if package:config("go") then
package:add("deps", "go")
end
if package:config("perl") and package:is_plat() and (not package:is_precompiled()) then
package:add("deps", "strawberry-perl")
end
end)

on_install("!cross and windows|!arm64", function (package)
if package:config("shared") and package:is_plat("windows") then
package:add("defines", "BORINGSSL_SHARED_LIBRARY")
end
Expand All @@ -32,14 +43,14 @@ package("aws-lc")
"-DBUILD_TESTING=OFF",
"-DCMAKE_INSTALL_INCLUDEDIR=include",
"-DBUILD_LIBSSL=ON",
"-DDISABLE_GO=ON", "-DDISABLE_PERL=ON"
}

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, "-DBUILD_LIBSSL=ON")
table.insert(configs, "-DENABLE_FIPS_ENTROPY_CPU_JITTER=" .. (package:config("jitter") and "ON" or "OFF"))
table.insert(configs, "-DDISABLE_GO=" .. (package:config("go") and "OFF" or "ON"))
table.insert(configs, "-DDISABLE_PERL=" .. (package:config("perl") and "OFF" or "ON"))
table.insert(configs, "-DBUILD_TOOL=" .. (package:config("tools") and "ON" or "OFF"))
import("package.tools.cmake").install(package, configs)
end)
Expand Down
Loading