|
@@ -109,9 +109,29 @@ function _add_opt(package, opt)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
|
|
|
|
+function _patch()
|
|
|
|
+ -- https://github.com/microsoft/vcpkg/pull/38806
|
|
|
|
+ local file = io.open("libs/container/CMakeLists.txt", "a")
|
|
|
|
+ file:write([[
|
|
|
|
+ if(NOT WIN32)
|
|
|
|
+ set(THREADS_PREFER_PTHREAD_FLAG 1)
|
|
|
|
+ find_package(Threads REQUIRED)
|
|
|
|
+ target_link_libraries(boost_container PUBLIC Threads::Threads)
|
|
|
|
+ if(EMSCRIPTEN)
|
|
|
|
+ # Boost config needs `-pthread` to see `_POSIX_THREADS`,
|
|
|
|
+ # but FindTheads.cmake finishes with `CMAKE_HAVE_LIBC_PTHREAD`.
|
|
|
|
+ target_compile_options(boost_container PUBLIC -pthread)
|
|
|
|
+ endif()
|
|
|
|
+ endif()
|
|
|
|
+ ]])
|
|
|
|
+ file:close()
|
|
|
|
+end
|
|
|
|
+
|
|
function main(package)
|
|
function main(package)
|
|
import("libs", {rootdir = package:scriptdir()})
|
|
import("libs", {rootdir = package:scriptdir()})
|
|
|
|
|
|
|
|
+ _patch()
|
|
|
|
+
|
|
local configs = {"-DBOOST_INSTALL_LAYOUT=system"}
|
|
local configs = {"-DBOOST_INSTALL_LAYOUT=system"}
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
|
|
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_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|