Fix PCRE2 static runtime link (#624)

pull/625/head
Jérôme Leclercq 3 years ago committed by GitHub
parent 39dcf26bd4
commit 8393ebaaa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      packages/p/pcre2/xmake.lua

@ -27,6 +27,9 @@ package("pcre2")
end)
on_install("windows", function (package)
if package:version():lt("10.21") then
io.replace("CMakeLists.txt", [[SET(CMAKE_C_FLAGS -I${PROJECT_SOURCE_DIR}/src)]], [[SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I${PROJECT_SOURCE_DIR}/src")]], {plain = true})
end
local configs = {"-DPCRE2_BUILD_TESTS=OFF", "-DPCRE2_BUILD_PCRE2GREP=OFF"}
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DPCRE2_SUPPORT_JIT=" .. (package:config("jit") and "ON" or "OFF"))
@ -38,6 +41,9 @@ package("pcre2")
if package:debug() then
table.insert(configs, "-DPCRE2_DEBUG=ON")
end
if package:is_plat("windows") then
table.insert(configs, "-DPCRE2_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF"))
end
import("package.tools.cmake").install(package, configs)
end)

Loading…
Cancel
Save