improve folly (#4348)

* improve folly

* Update xmake.lua

* add back old version

* add old patches
pull/4358/head
c8ef 5 months ago committed by GitHub
parent 5daf74dc4e
commit ddd9920a9c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 25
      packages/f/folly/xmake.lua

@ -19,6 +19,7 @@ package("folly")
add_versions("2024.03.18", "037bd742b91e35e057d13bedcbdf55328e35805cf91f7bc1ca850a72ba974578") add_versions("2024.03.18", "037bd742b91e35e057d13bedcbdf55328e35805cf91f7bc1ca850a72ba974578")
add_versions("2024.03.25", "3c57b0d1f1266e935aef1ed54535561fd2eeedc1aa946fbc46871e839014f74c") add_versions("2024.03.25", "3c57b0d1f1266e935aef1ed54535561fd2eeedc1aa946fbc46871e839014f74c")
add_versions("2024.04.01", "f09e522c76a5f102c40c54726f6f255b0dc127c78f9c8c9ac117fc0f7ac284bb") add_versions("2024.04.01", "f09e522c76a5f102c40c54726f6f255b0dc127c78f9c8c9ac117fc0f7ac284bb")
add_versions("2024.06.10", "27d7f825a9a3469b59a4f0a5ba2edac733407ea8dcc036e7ca9279d803ece1e9")
add_patches("<=2022.08.29", path.join(os.scriptdir(), "patches", "2021.06.28", "reorder.patch"), "9a6bf283881580474040cfc7a8e89d461d68b89bae5583d89fff0a3198739980") add_patches("<=2022.08.29", path.join(os.scriptdir(), "patches", "2021.06.28", "reorder.patch"), "9a6bf283881580474040cfc7a8e89d461d68b89bae5583d89fff0a3198739980")
add_patches("<=2022.08.29", path.join(os.scriptdir(), "patches", "2021.06.28", "regex.patch"), "6a77ade9f48dd9966d3f7154e66ca8a5c030ae2b6d335cbe3315784aefd8f495") add_patches("<=2022.08.29", path.join(os.scriptdir(), "patches", "2021.06.28", "regex.patch"), "6a77ade9f48dd9966d3f7154e66ca8a5c030ae2b6d335cbe3315784aefd8f495")
@ -38,13 +39,16 @@ package("folly")
add_syslinks("pthread") add_syslinks("pthread")
end end
on_load("linux", function (package)
package:add("deps", "libaio")
package:add("deps", "liburing")
end)
on_install("linux", "macosx", function (package) on_install("linux", "macosx", function (package)
local configs = {"-DBUILD_TESTS=OFF", local configs = {"-DBUILD_TESTS=OFF",
"-DCMAKE_DISABLE_FIND_PACKAGE_LibDwarf=ON", "-DCMAKE_DISABLE_FIND_PACKAGE_LibDwarf=ON",
"-DCMAKE_DISABLE_FIND_PACKAGE_Libiberty=ON", "-DCMAKE_DISABLE_FIND_PACKAGE_Libiberty=ON",
"-DCMAKE_DISABLE_FIND_PACKAGE_LibAIO=ON",
"-DCMAKE_DISABLE_FIND_PACKAGE_LibURCU=ON", "-DCMAKE_DISABLE_FIND_PACKAGE_LibURCU=ON",
"-DLIBAIO_FOUND=OFF",
"-DLIBURCU_FOUND=OFF", "-DLIBURCU_FOUND=OFF",
"-DBOOST_LINK_STATIC=ON", "-DBOOST_LINK_STATIC=ON",
"-DCMAKE_CXX_STANDARD=17"} "-DCMAKE_CXX_STANDARD=17"}
@ -53,10 +57,14 @@ package("folly")
if package:is_plat("windows") then if package:is_plat("windows") then
table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
end end
if not package:is_plat("linux") then
table.insert(configs, "-DCMAKE_DISABLE_FIND_PACKAGE_LibAIO=ON")
table.insert(configs, "-DLIBAIO_FOUND=OFF")
end
import("package.tools.cmake").install(package, configs) import("package.tools.cmake").install(package, configs)
end) end)
on_test(function (package) on_test("macosx", function (package)
assert(package:check_cxxsnippets({test = [[ assert(package:check_cxxsnippets({test = [[
#include <cassert> #include <cassert>
void test() { void test() {
@ -65,3 +73,14 @@ package("folly")
} }
]]}, {configs = {languages = "c++17"}, includes = "folly/CpuId.h"})) ]]}, {configs = {languages = "c++17"}, includes = "folly/CpuId.h"}))
end) end)
on_test("linux", function (package)
assert(package:check_cxxsnippets({test = [[
#include "folly/experimental/io/IoUring.h"
#include "folly/experimental/io/AsyncIO.h"
void test() {
folly::AsyncIOOp asyncIOOp;
folly::IoUringOp ioUringOp;
}
]]}, {configs = {languages = "c++17"}}))
end)

Loading…
Cancel
Save