Skip to content

Commit 95dc77f

Browse files
authored
add libbcrypt package (#10563)
* add libbcrypt package * don't build for windows
1 parent 05b6236 commit 95dc77f

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

packages/l/libbcrypt/xmake.lua

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package("libbcrypt")
2+
set_homepage("https://github.com/trusch/libbcrypt")
3+
set_description("A c++ wrapper around bcrypt password hashing")
4+
set_license("MIT")
5+
6+
add_urls("https://github.com/trusch/libbcrypt.git")
7+
8+
add_versions("2021.06.22", "d6523c370de6e724ce4ec703e2449b5b028ea3b1")
9+
10+
add_deps("cmake")
11+
12+
on_install("!windows and !mingw", function (package)
13+
local configs = {}
14+
15+
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
16+
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
17+
18+
import("package.tools.cmake").install(package, configs)
19+
end)
20+
21+
on_test(function (package)
22+
assert(package:check_cxxsnippets({test = [[
23+
void test() {
24+
std::string password = "test";
25+
std::string hash = BCrypt::generateHash(password);
26+
27+
BCrypt::validatePassword(password,hash);
28+
BCrypt::validatePassword("test1",hash);
29+
}
30+
]]}, {configs = {languages = "c++17"}, includes = "bcrypt/BCrypt.hpp"}))
31+
end)

0 commit comments

Comments
 (0)