|
@@ -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)
|
|
|
|