mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-28 23:48:59 +08:00
404819d78f
* Check if files exists before call vcpkg_replace_string. * Update per comments. Only guard debug. * Update ports/pcre2/portfile.cmake Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> * Bump port-version. Co-authored-by: GLUD Lars <lars.glud@leica-geosystems.com> Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com> Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
65 lines
2.3 KiB
CMake
65 lines
2.3 KiB
CMake
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO PhilipHazel/pcre2
|
|
REF 35fee4193b852cb504892352bd0155de10809889 # pcre2-10.39
|
|
SHA512 a6e50f3354dc4172df05e887dd8646d4ce6a3584fe180b17dc27b42b094e13d1d1a7e5ab3cb15dd352764d81ac33cfd03e81b0c890d9ddec72d823ca6f8bd667
|
|
HEAD_REF master
|
|
PATCHES
|
|
pcre2-10.35_fix-uwp.patch
|
|
)
|
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
|
|
|
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Emscripten" OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "iOS")
|
|
set(JIT OFF)
|
|
else()
|
|
set(JIT ON)
|
|
endif()
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS
|
|
-DBUILD_STATIC_LIBS=${BUILD_STATIC}
|
|
-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_cmake_install()
|
|
vcpkg_copy_pdbs()
|
|
|
|
file(READ "${CURRENT_PACKAGES_DIR}/include/pcre2.h" PCRE2_H)
|
|
if(BUILD_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()
|
|
|
|
# The cmake file provided by pcre2 has some problems, so don't use it for now.
|
|
#vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/cmake" "${CURRENT_PACKAGES_DIR}/debug/cmake")
|
|
|
|
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(BUILD_STATIC)
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
elseif(VCPKG_TARGET_IS_WINDOWS)
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/pcre2-config" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/..")
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/pcre2-config")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/pcre2-config" "${CURRENT_PACKAGES_DIR}" "`dirname $0`/../..")
|
|
endif()
|
|
endif()
|
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|