Fixes windows workflow for PCRE2 (#260)

This commit is contained in:
Jerin Philip 2021-11-05 20:48:28 +00:00 committed by GitHub
parent fa4efb483b
commit 5a693b7eec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 90 additions and 3 deletions

View File

@ -39,7 +39,7 @@ jobs:
- name: Prepare vcpkg
uses: lukka/run-vcpkg@v7.4
with:
vcpkgArguments: protobuf
vcpkgArguments: protobuf pcre2 --overlay-ports="${{ github.workspace }}\vcpkg-override\ports\pcre2"
vcpkgGitCommitId: 8dddc6c899ce6fdbeab38b525a31e7f23cb2d5bb
vcpkgDirectory: ${{ github.workspace }}/vcpkg/
vcpkgTriplet: x64-windows-static
@ -51,7 +51,6 @@ jobs:
buildDirectory: ${{ github.workspace }}/build
cmakeAppendedArgs: '-G Ninja
-DCMAKE_BUILD_TYPE="Release"
-DSSPLIT_USE_INTERNAL_PCRE2="ON"
-DUSE_WASM_COMPATIBLE_SOURCE="OFF"
-DUSE_STATIC_LIBS="TRUE"'
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced

@ -1 +1 @@
Subproject commit 36beacd1ee4d9d591346d8e0f7f7700c7a91eb9f
Subproject commit a08d6bce20619a8475736832d5418458c14db9d4

View File

@ -0,0 +1,10 @@
--- a/CMakeLists.txt 2020-05-09 16:43:10.000000000 +0200
+++ b/CMakeLists.txt 2020-06-03 20:57:17.026182500 +0200
@@ -619,6 +619,7 @@
IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS)
+ add_compile_options(/wd4146)
ENDIF(MSVC)
SET(CMAKE_INCLUDE_CURRENT_DIR 1)

View File

@ -0,0 +1,72 @@
set(PCRE2_VERSION 10.37)
set(EXPECTED_SHA f91760a8e0747f52211612fb0e134d685e224d16bd884eb574718d077a586b1fd7b6435d4e3b75c879b12e02b252467ecc28cdc4bc2903c783dacab089f99c99)
set(PATCHES
pcre2-10.35_fix-uwp.patch
)
vcpkg_download_distfile(ARCHIVE
URLS "https://sourceforge.net/projects/pcre/files/pcre2/${PCRE2_VERSION}/pcre2-${PCRE2_VERSION}.zip"
FILENAME "pcre2-${PCRE2_VERSION}.zip"
SHA512 ${EXPECTED_SHA}
SILENT_EXIT
)
if (EXISTS "${ARCHIVE}")
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES ${PATCHES}
)
else()
vcpkg_from_sourceforge(
OUT_SOURCE_PATH SOURCE_PATH
REPO pcre/pcre2
REF ${PCRE2_VERSION}
FILENAME "pcre2-${PCRE2_VERSION}.zip"
SHA512 ${EXPECTED_SHA}
PATCHES ${PATCHES}
)
endif()
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS")
set(JIT OFF)
else()
set(JIT ON)
endif()
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DPCRE2_BUILD_PCRE2_8=ON
-DPCRE2_BUILD_PCRE2_16=ON
-DPCRE2_BUILD_PCRE2_32=ON
-DPCRE2_SUPPORT_JIT=${JIT}
-DPCRE2_SUPPORT_UNICODE=ON
-DPCRE2_BUILD_TESTS=OFF
-DPCRE2_BUILD_PCRE2GREP=OFF)
vcpkg_install_cmake()
file(READ ${CURRENT_PACKAGES_DIR}/include/pcre2.h PCRE2_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "defined(PCRE2_STATIC)" "1" PCRE2_H "${PCRE2_H}")
else()
string(REPLACE "defined(PCRE2_STATIC)" "0" PCRE2_H "${PCRE2_H}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/pcre2.h "${PCRE2_H}")
vcpkg_fixup_pkgconfig()
vcpkg_copy_pdbs()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/share/doc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/man)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

View File

@ -0,0 +1,6 @@
{
"name": "pcre2",
"version-string": "10.37",
"description": "PCRE2 is a re-working of the original Perl Compatible Regular Expressions library",
"homepage": "https://pcre.org/"
}