From 946d4c1ddfd4d8b38c0b711d49ba08c1875c3003 Mon Sep 17 00:00:00 2001 From: Aleksey Dobrunov Date: Fri, 24 Jan 2025 23:04:42 +0500 Subject: [PATCH] optimize build - use standard icu port instead own - add release triplets for CI build speedup - moved the files for vcpkg to a separate folder --- .github/workflows/colorer_ci.yml | 5 +- .github/workflows/prebuild.yml | 5 +- .github/workflows/release.yml | 5 +- CMakeLists.txt | 7 + CMakePresets.json | 6 +- README.md | 4 +- .../icu/disable-escapestr-tool.patch | 17 -- .../icu/disable-static-prefix.patch | 20 -- external/vcpkg-ports/icu/fix-extra.patch | 13 -- external/vcpkg-ports/icu/fix-win-build.patch | 35 --- .../icu/fix_parallel_build_on_windows.patch | 25 --- .../vcpkg-ports/icu/mingw-dll-install.patch | 26 --- external/vcpkg-ports/icu/portfile.cmake | 205 ------------------ .../icu/remove-MD-from-configure.patch | 18 -- .../vcpkg-ports/icu/vcpkg-cmake-wrapper.cmake | 8 - external/vcpkg-ports/icu/vcpkg.json | 26 --- .../manifest/vcpkg-configuration.json | 4 +- vcpkg.json => vcpkg/manifest/vcpkg.json | 12 +- vcpkg/triplets/arm64-win-static-rel.cmake | 7 + vcpkg/triplets/arm64-win-static.cmake | 5 + vcpkg/triplets/x64-win-static-rel.cmake | 7 + vcpkg/triplets/x64-win-static.cmake | 5 + vcpkg/triplets/x86-win-static-rel.cmake | 7 + vcpkg/triplets/x86-win-static.cmake | 5 + 24 files changed, 59 insertions(+), 418 deletions(-) delete mode 100644 external/vcpkg-ports/icu/disable-escapestr-tool.patch delete mode 100644 external/vcpkg-ports/icu/disable-static-prefix.patch delete mode 100644 external/vcpkg-ports/icu/fix-extra.patch delete mode 100644 external/vcpkg-ports/icu/fix-win-build.patch delete mode 100644 external/vcpkg-ports/icu/fix_parallel_build_on_windows.patch delete mode 100644 external/vcpkg-ports/icu/mingw-dll-install.patch delete mode 100644 external/vcpkg-ports/icu/portfile.cmake delete mode 100644 external/vcpkg-ports/icu/remove-MD-from-configure.patch delete mode 100644 external/vcpkg-ports/icu/vcpkg-cmake-wrapper.cmake delete mode 100644 external/vcpkg-ports/icu/vcpkg.json rename vcpkg-configuration.json => vcpkg/manifest/vcpkg-configuration.json (71%) rename vcpkg.json => vcpkg/manifest/vcpkg.json (65%) create mode 100644 vcpkg/triplets/arm64-win-static-rel.cmake create mode 100644 vcpkg/triplets/arm64-win-static.cmake create mode 100644 vcpkg/triplets/x64-win-static-rel.cmake create mode 100644 vcpkg/triplets/x64-win-static.cmake create mode 100644 vcpkg/triplets/x86-win-static-rel.cmake create mode 100644 vcpkg/triplets/x86-win-static.cmake diff --git a/.github/workflows/colorer_ci.yml b/.github/workflows/colorer_ci.yml index abd0bd21..65967dcf 100644 --- a/.github/workflows/colorer_ci.yml +++ b/.github/workflows/colorer_ci.yml @@ -133,9 +133,9 @@ jobs: zip: [ON, OFF] include: - arch: x64 - triplet: x64-windows-static + triplet: x64-win-static-rel - arch: x86 - triplet: x86-windows-static + triplet: x86-win-static-rel exclude: - arch: x86 zip: OFF @@ -182,7 +182,6 @@ jobs: -DCOLORER_BUILD_TEST=ON -DCOLORER_BUILD_ARCH=${{ matrix.arch }} -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake - -DVCPKG_OVERLAY_PORTS=$GITHUB_WORKSPACE/external/vcpkg-ports -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }} -DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }} diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml index 08db11b0..4118d63a 100644 --- a/.github/workflows/prebuild.yml +++ b/.github/workflows/prebuild.yml @@ -23,9 +23,9 @@ jobs: zip: [ON] include: - arch: x64 - triplet: x64-windows-static + triplet: x64-win-static-rel - arch: x86 - triplet: x86-windows-static + triplet: x86-win-static-rel name: windows-${{ matrix.arch }} @@ -65,7 +65,6 @@ jobs: -DCOLORER_BUILD_TEST=OFF -DCOLORER_BUILD_ARCH=${{ matrix.arch }} -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake - -DVCPKG_OVERLAY_PORTS=$GITHUB_WORKSPACE/external/vcpkg-ports -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DCOLORER_USE_ICU_STRINGS=${{ matrix.icu }} -DCOLORER_USE_ZIPINPUTSOURCE=${{ matrix.zip }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e4d97cf..8f72b6de 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,9 +64,9 @@ jobs: arch: [ x64, x86 ] include: - arch: x64 - triplet: x64-windows-static + triplet: x64-win-static-rel - arch: x86 - triplet: x86-windows-static + triplet: x86-win-static-rel env: BUILD_TYPE: Release @@ -110,7 +110,6 @@ jobs: -DCOLORER_BUILD_TEST=OFF -DCOLORER_BUILD_ARCH=${{ matrix.arch }} -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake - -DVCPKG_OVERLAY_PORTS=$GITHUB_WORKSPACE/external/vcpkg-ports -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} -DVCPKG_FEATURE_FLAGS=manifests,versions -DCMAKE_INSTALL_PREFIX=./install/colorer diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ee1258e..06f4f7ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,13 @@ endif() include(cmake/colorer_extract_version.cmake) colorer_extract_version() +#==================================================== +# vcpkg settings +#==================================================== +# set before declare project(...) +set(VCPKG_MANIFEST_DIR "${CMAKE_HOME_DIRECTORY}/vcpkg/manifest" CACHE STRING "Set the path to the manifest folder") +message(STATUS "Using vcpkg manifest: ${VCPKG_MANIFEST_DIR}/vcpkg.json") + #==================================================== # main project #==================================================== diff --git a/CMakePresets.json b/CMakePresets.json index e297c4f2..1b46a8ed 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -90,7 +90,7 @@ "name": "vcpkg_win_x64", "inherits": "vcpkg", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-static" + "VCPKG_TARGET_TRIPLET": "x64-win-static" }, "hidden": true }, @@ -98,7 +98,7 @@ "name": "vcpkg_win_x86", "inherits": "vcpkg", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x86-windows-static" + "VCPKG_TARGET_TRIPLET": "x86-win-static" }, "hidden": true }, @@ -106,7 +106,7 @@ "name": "vcpkg_win_arm64", "inherits": "vcpkg", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "arm64-windows-static" + "VCPKG_TARGET_TRIPLET": "arm64-win-static" }, "hidden": true }, diff --git a/README.md b/README.md index ea60f0f2..3c7315df 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ Build colorer and dependency, if they are not in the local cache: mkdir build cd build -cmake -S .. -G "NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCOLORER_BUILD_ARCH=x64 +cmake -S .. -G "NMake Makefiles" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-win-static -DCOLORER_BUILD_ARCH=x64 cmake --build . ``` -For x86 platform use `-DVCPKG_TARGET_TRIPLET=x86-windows-static -DCOLORER_BUILD_ARCH=x86`, arm64 - `-DVCPKG_TARGET_TRIPLET=arm64-windows-static -DCOLORER_BUILD_ARCH=arm64`. +For x86 platform use `-DVCPKG_TARGET_TRIPLET=x86-win-static -DCOLORER_BUILD_ARCH=x86`, arm64 - `-DVCPKG_TARGET_TRIPLET=arm64-win-static -DCOLORER_BUILD_ARCH=arm64`. Once built, the dependencies will be cached in the local cache. diff --git a/external/vcpkg-ports/icu/disable-escapestr-tool.patch b/external/vcpkg-ports/icu/disable-escapestr-tool.patch deleted file mode 100644 index 5c42e56e..00000000 --- a/external/vcpkg-ports/icu/disable-escapestr-tool.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/source/tools/Makefile.in b/source/tools/Makefile.in -index e0896f1..5ead980 100644 ---- a/source/tools/Makefile.in -+++ b/source/tools/Makefile.in -@@ -19,9 +19,9 @@ SUBDIRS = toolutil ctestfw makeconv genrb genbrk \ - gencnval gensprep icuinfo genccode gencmn icupkg pkgdata \ - gentest gennorm2 gencfu gendict icuexportdata - --ifneq (@platform_make_fragment_name@,mh-cygwin-msvc) --SUBDIRS += escapesrc --endif -+#ifneq (@platform_make_fragment_name@,mh-cygwin-msvc) -+#SUBDIRS += escapesrc -+#endif - - ## List of phony targets - .PHONY : all all-local all-recursive install install-local \ diff --git a/external/vcpkg-ports/icu/disable-static-prefix.patch b/external/vcpkg-ports/icu/disable-static-prefix.patch deleted file mode 100644 index 4e63e337..00000000 --- a/external/vcpkg-ports/icu/disable-static-prefix.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/source/icudefs.mk.in b/source/icudefs.mk.in -index 24bd97a..33169de 100644 ---- a/source/icudefs.mk.in -+++ b/source/icudefs.mk.in -@@ -213,13 +213,13 @@ LIBICU = $(LIBPREFIX)$(ICUPREFIX) - - ## If we can't use the shared libraries, use the static libraries - ifneq ($(ENABLE_SHARED),YES) --STATIC_PREFIX_WHEN_USED = s -+STATIC_PREFIX_WHEN_USED = - else - STATIC_PREFIX_WHEN_USED = - endif - - # Static library prefix and file extension --STATIC_PREFIX = s -+STATIC_PREFIX = - LIBSICU = $(LIBPREFIX)$(STATIC_PREFIX)$(ICUPREFIX) - A = a - SOBJ = $(SO) diff --git a/external/vcpkg-ports/icu/fix-extra.patch b/external/vcpkg-ports/icu/fix-extra.patch deleted file mode 100644 index ee0142cf..00000000 --- a/external/vcpkg-ports/icu/fix-extra.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --urN a/source/extra/Makefile.in b/source/extra/Makefile.in ---- a/source/extra/Makefile.in -+++ b/source/extra/Makefile.in -@@ -23,7 +23,7 @@ - ## Files to remove for 'make clean' - CLEANFILES = *~ - --SUBDIRS = scrptrun uconv -+SUBDIRS = uconv - - ## List of phony targets - .PHONY : all all-local all-recursive install install-local \ - diff --git a/external/vcpkg-ports/icu/fix-win-build.patch b/external/vcpkg-ports/icu/fix-win-build.patch deleted file mode 100644 index 0c2e46cf..00000000 --- a/external/vcpkg-ports/icu/fix-win-build.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/source/configure.ac b/source/configure.ac -index 425fdc7..97210f8 100644 ---- a/source/configure.ac -+++ b/source/configure.ac -@@ -114,6 +114,15 @@ AC_ARG_ENABLE([icu-config], - esac], [enable_icu_config=true]) - AC_SUBST(INSTALL_ICU_CONFIG, [$enable_icu_config]) - -+AC_ARG_ENABLE([icu-build-win], -+ AS_HELP_STRING([--enable-icu-build-win], [install icu-build-win]), -+ [case "${enableval}" in -+ yes) enable_icu_build_win=true ;; -+ no) enable_icu_build_win=false ;; -+ *) AC_MSG_ERROR([bad value '${enableval}' for --enable-icu-build-win]) ;; -+ esac], [enable_icu_build_win=true]) -+AC_SUBST(INSTALL_ICU_BUILD_WIN, [$enable_icu_build_win]) -+ - # Check whether to build debug libraries - AC_MSG_CHECKING([whether to build debug libraries]) - enabled=no -@@ -263,12 +272,14 @@ ICU_CHECK_MH_FRAG - # Checks for libraries and other host specific stuff - # On HP/UX, don't link to -lm from a shared lib because it isn't - # PIC (at least on 10.2) -+if test "$enable_icu_build_win" = no; then - case "${host}" in - *-*-hpux*) AC_CHECK_LIB(m, floor, LIB_M="-lm") ;; - - *) AC_CHECK_LIB(m, floor) - LIB_M="" ;; - esac -+fi - AC_SUBST(LIB_M) - - # Check whether to build shared libraries diff --git a/external/vcpkg-ports/icu/fix_parallel_build_on_windows.patch b/external/vcpkg-ports/icu/fix_parallel_build_on_windows.patch deleted file mode 100644 index 6bd91094..00000000 --- a/external/vcpkg-ports/icu/fix_parallel_build_on_windows.patch +++ /dev/null @@ -1,25 +0,0 @@ -diff --urN a/source/data/Makefile.in b/source/data/Makefile.in ---- a/source/data/Makefile.in -+++ b/source/data/Makefile.in -@@ -236,11 +236,12 @@ - ## Include the main build rules for data files - include $(top_builddir)/$(subdir)/rules.mk - -+PKGDATA_LIST = $(TMP_DIR)/icudata.lst - - ifeq ($(ENABLE_SO_VERSION_DATA),1) - ifeq ($(PKGDATA_MODE),dll) - SO_VERSION_DATA = $(OUTTMPDIR)/icudata.res --$(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc | $(TMP_DIR)/dirs.timestamp -+$(SO_VERSION_DATA) : $(MISCSRCDIR)/icudata.rc $(PKGDATA_LIST) - ifeq ($(MSYS_RC_MODE),1) - rc.exe -i$(srcdir)/../common -i$(top_builddir)/common -fo$@ $(CPPFLAGS) $< - else -@@ -249,7 +250,6 @@ - endif - endif - --PKGDATA_LIST = $(TMP_DIR)/icudata.lst - - - ##################################################### diff --git a/external/vcpkg-ports/icu/mingw-dll-install.patch b/external/vcpkg-ports/icu/mingw-dll-install.patch deleted file mode 100644 index af3b448a..00000000 --- a/external/vcpkg-ports/icu/mingw-dll-install.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/source/config/mh-mingw b/source/config/mh-mingw -index 30f6e5be81..b6364551ea 100644 ---- a/source/config/mh-mingw -+++ b/source/config/mh-mingw -@@ -13,7 +13,7 @@ - # On Windows we generally have the DLLs in the bin directory rather than the lib directory. - # This setting moves the ICU DLLs into the bin folder for MinGW/MSYS2 when "make install" is run. - # If you prefer to have the DLLs in the lib folder, then set this to NO instead. --MINGW_MOVEDLLSTOBINDIR = YES -+MINGW_MOVEDLLSTOBINDIR = NO - - # We install sbin tools into the same bin directory because - # pkgdata needs some of the tools in sbin, and we can't always depend on -diff --git a/source/config/mh-mingw64 b/source/config/mh-mingw64 -index fb64c56260..a43cc4dd71 100644 ---- a/source/config/mh-mingw64 -+++ b/source/config/mh-mingw64 -@@ -10,7 +10,7 @@ - # On Windows we generally have the DLLs in the bin directory rather than the lib directory. - # This setting moves the ICU DLLs into the bin folder for MinGW/MSYS2 when "make install" is run. - # If you prefer to have the DLLs in the lib folder, then set this to NO instead. --MINGW_MOVEDLLSTOBINDIR = YES -+MINGW_MOVEDLLSTOBINDIR = NO - - # This file is similar to mh-mingw - # Any changes made here may also need to be made in mh-mingw diff --git a/external/vcpkg-ports/icu/portfile.cmake b/external/vcpkg-ports/icu/portfile.cmake deleted file mode 100644 index daa0179c..00000000 --- a/external/vcpkg-ports/icu/portfile.cmake +++ /dev/null @@ -1,205 +0,0 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} -string(REGEX MATCH "^[0-9]*" ICU_VERSION_MAJOR "${VERSION}") -string(REPLACE "." "_" VERSION2 "${VERSION}") -string(REPLACE "." "-" VERSION3 "${VERSION}") - -vcpkg_download_distfile( - ARCHIVE - URLS "https://github.com/unicode-org/icu/releases/download/release-${VERSION3}/icu4c-${VERSION2}-src.tgz" - FILENAME "icu4c-${VERSION2}-src.tgz" - SHA512 848c341b37c0ff077e34a95d92c6200d5aaddd0ee5e06134101a74e04deb08256a5e817c8aefab020986abe810b7827dd7b2169a60dacd250c298870518dcae8 -) - -vcpkg_extract_source_archive(SOURCE_PATH - ARCHIVE "${ARCHIVE}" - PATCHES - disable-escapestr-tool.patch - remove-MD-from-configure.patch - fix_parallel_build_on_windows.patch - fix-extra.patch - mingw-dll-install.patch - disable-static-prefix.patch # https://gitlab.kitware.com/cmake/cmake/-/issues/16617; also mingw. - fix-win-build.patch -) - -vcpkg_find_acquire_program(PYTHON3) -set(ENV{PYTHON} "${PYTHON3}") - -if(VCPKG_TARGET_IS_WINDOWS) - list(APPEND CONFIGURE_OPTIONS --enable-icu-build-win) -endif() - -list(APPEND CONFIGURE_OPTIONS --disable-samples --disable-tests --disable-layoutex) - -list(APPEND CONFIGURE_OPTIONS_RELEASE --disable-debug --enable-release) -list(APPEND CONFIGURE_OPTIONS_DEBUG --enable-debug --disable-release) - -set(RELEASE_TRIPLET ${TARGET_TRIPLET}-rel) -set(DEBUG_TRIPLET ${TARGET_TRIPLET}-dbg) - -if("tools" IN_LIST FEATURES) - list(APPEND CONFIGURE_OPTIONS --enable-tools) -else() - list(APPEND CONFIGURE_OPTIONS --disable-tools) -endif() - -if ("data-archive" IN_LIST FEATURES) - list(APPEND CONFIGURE_OPTIONS --with-data-packaging=archive) -endif() - -if(CMAKE_HOST_WIN32 AND VCPKG_TARGET_IS_MINGW AND NOT HOST_TRIPLET MATCHES "mingw") - # Assuming no cross compiling because the host (windows) pkgdata tool doesn't - # use the '/' path separator when creating compiler commands for mingw bash. -elseif(VCPKG_CROSSCOMPILING) - set(TOOL_PATH "${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT}") - # convert to unix path - string(REGEX REPLACE "^([a-zA-Z]):/" "/\\1/" _VCPKG_TOOL_PATH "${TOOL_PATH}") - list(APPEND CONFIGURE_OPTIONS "--with-cross-build=${_VCPKG_TOOL_PATH}") -endif() - -vcpkg_configure_make( - SOURCE_PATH "${SOURCE_PATH}" - AUTOCONFIG - PROJECT_SUBPATH source - ADDITIONAL_MSYS_PACKAGES autoconf-archive - OPTIONS ${CONFIGURE_OPTIONS} - OPTIONS_RELEASE ${CONFIGURE_OPTIONS_RELEASE} - OPTIONS_DEBUG ${CONFIGURE_OPTIONS_DEBUG} - DETERMINE_BUILD_TRIPLET -) - -if(VCPKG_TARGET_IS_OSX AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - - vcpkg_build_make() - # remove this block if https://unicode-org.atlassian.net/browse/ICU-21458 - # is resolved and use the configure script instead - if(DEFINED CMAKE_INSTALL_NAME_DIR) - set(ID_PREFIX "${CMAKE_INSTALL_NAME_DIR}") - else() - set(ID_PREFIX "@rpath") - endif() - - # install_name_tool may be missing if cross-compiling - find_program( - INSTALL_NAME_TOOL - install_name_tool - HINTS /usr/bin /Library/Developer/CommandLineTools/usr/bin/ - DOC "Absolute path of install_name_tool" - REQUIRED - ) - - message(STATUS "setting rpath prefix for macOS dynamic libraries") - - # add ID_PREFIX to libicudata libicui18n libicuio libicutu libicuuc - foreach(LIB_NAME IN ITEMS libicudata libicui18n libicuio libicutu libicuuc) - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -id "${ID_PREFIX}/${LIB_NAME}.${ICU_VERSION_MAJOR}.dylib" - "${LIB_NAME}.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - endforeach() - - # add ID_PREFIX to libicui18n libicuio libicutu dependencies - foreach(LIB_NAME IN ITEMS libicui18n libicuio) - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -change "libicuuc.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicuuc.${ICU_VERSION_MAJOR}.dylib" - "${LIB_NAME}.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -change "libicudata.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" - "${LIB_NAME}.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - endforeach() - - # add ID_PREFIX to remaining libicuio libicutu dependencies - foreach(LIB_NAME libicuio libicutu) - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -change "libicui18n.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicui18n.${ICU_VERSION_MAJOR}.dylib" - "${LIB_NAME}.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) - endforeach() - - # add ID_PREFIX to libicuuc dependencies - vcpkg_execute_build_process( - COMMAND "${INSTALL_NAME_TOOL}" -change "libicudata.${ICU_VERSION_MAJOR}.dylib" - "${ID_PREFIX}/libicudata.${ICU_VERSION_MAJOR}.dylib" - "libicuuc.${VERSION}.dylib" - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/lib" - LOGNAME "make-build-fix-rpath-${RELEASE_TRIPLET}" - ) -endif() - -vcpkg_install_make() - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/share" - "${CURRENT_PACKAGES_DIR}/debug/share" - "${CURRENT_PACKAGES_DIR}/lib/icu" - "${CURRENT_PACKAGES_DIR}/debug/lib/icu" - "${CURRENT_PACKAGES_DIR}/debug/lib/icud") - -file(GLOB TEST_LIBS - "${CURRENT_PACKAGES_DIR}/lib/*test*" - "${CURRENT_PACKAGES_DIR}/debug/lib/*test*") -if(TEST_LIBS) - file(REMOVE ${TEST_LIBS}) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - # force U_STATIC_IMPLEMENTATION macro - foreach(HEADER utypes.h utf_old.h platform.h) - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/unicode/${HEADER}" "defined(U_STATIC_IMPLEMENTATION)" "1") - endforeach() -endif() - -# Install executables from /tools/icu/sbin to /tools/icu/bin on unix (/bin because icu require this for cross compiling) -if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX AND "tools" IN_LIST FEATURES) - vcpkg_copy_tools( - TOOL_NAMES icupkg gennorm2 gencmn genccode gensprep - SEARCH_DIR "${CURRENT_PACKAGES_DIR}/tools/icu/sbin" - DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin" - ) -endif() - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/tools/icu/sbin" - "${CURRENT_PACKAGES_DIR}/tools/icu/debug") - -# To cross compile, we need some files at specific positions. So lets copy them -file(GLOB CROSS_COMPILE_DEFS "${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/config/icucross.*") -file(INSTALL ${CROSS_COMPILE_DEFS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/config") - -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*icu*${ICU_VERSION_MAJOR}.dll") -file(COPY ${RELEASE_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin") - -# copy dlls -file(GLOB RELEASE_DLLS "${CURRENT_PACKAGES_DIR}/lib/*icu*${ICU_VERSION_MAJOR}.dll") -file(COPY ${RELEASE_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin") -if(NOT VCPKG_BUILD_TYPE) - file(GLOB DEBUG_DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*icu*${ICU_VERSION_MAJOR}.dll") - file(COPY ${DEBUG_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() - -# remove any remaining dlls in /lib -file(GLOB DUMMY_DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll" "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -if(DUMMY_DLLS) - file(REMOVE ${DUMMY_DLLS}) -endif() - -vcpkg_copy_pdbs() -vcpkg_fixup_pkgconfig() - -vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/tools/icu/bin/icu-config" "${CURRENT_INSTALLED_DIR}" "`dirname $0`/../../../") - -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/external/vcpkg-ports/icu/remove-MD-from-configure.patch b/external/vcpkg-ports/icu/remove-MD-from-configure.patch deleted file mode 100644 index fe4782b3..00000000 --- a/external/vcpkg-ports/icu/remove-MD-from-configure.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff -urN a/source/runConfigureICU b/source/runConfigureICU ---- a/source/runConfigureICU 2018-03-26 21:38:44.000000000 +0800 -+++ b/source/runConfigureICU 2018-08-26 09:04:53.197454400 +0800 -@@ -322,10 +322,10 @@ - THE_COMP="Microsoft Visual C++" - CC=cl; export CC - CXX=cl; export CXX -- RELEASE_CFLAGS='-Gy -MD' -- RELEASE_CXXFLAGS='-Gy -MD' -- DEBUG_CFLAGS='-FS -Zi -MDd' -- DEBUG_CXXFLAGS='-FS -Zi -MDd' -+ RELEASE_CFLAGS='-Gy' -+ RELEASE_CXXFLAGS='-Gy' -+ DEBUG_CFLAGS='-FS -Zi' -+ DEBUG_CXXFLAGS='-FS -Zi' - DEBUG_LDFLAGS='-DEBUG' - ;; - *BSD) diff --git a/external/vcpkg-ports/icu/vcpkg-cmake-wrapper.cmake b/external/vcpkg-ports/icu/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 2a22afa4..00000000 --- a/external/vcpkg-ports/icu/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,8 +0,0 @@ -cmake_policy(PUSH) -cmake_policy(SET CMP0057 NEW) -if(NOT "COMPONENTS" IN_LIST ARGS) - _find_package(${ARGS} COMPONENTS data) -else() - _find_package(${ARGS}) -endif() -cmake_policy(POP) diff --git a/external/vcpkg-ports/icu/vcpkg.json b/external/vcpkg-ports/icu/vcpkg.json deleted file mode 100644 index adf8f08d..00000000 --- a/external/vcpkg-ports/icu/vcpkg.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "icu", - "version": "72.1", - "port-version": 3, - "description": "Mature and widely used Unicode and localization library.", - "homepage": "https://icu.unicode.org/home", - "license": "ICU", - "supports": "!uwp", - "dependencies": [ - { - "name": "icu", - "host": true, - "features": [ - "tools" - ] - } - ], - "features": { - "tools": { - "description": "Build tools" - }, - "data-archive": { - "description": "build a single icudtXX.dat file" - } - } -} diff --git a/vcpkg-configuration.json b/vcpkg/manifest/vcpkg-configuration.json similarity index 71% rename from vcpkg-configuration.json rename to vcpkg/manifest/vcpkg-configuration.json index 97688b3b..c5fb5799 100644 --- a/vcpkg-configuration.json +++ b/vcpkg/manifest/vcpkg-configuration.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg-configuration.schema.json", "overlay-ports": [ - "./external/vcpkg-ports" - ] + ], + "overlay-triplets": [ "../../vcpkg/triplets" ] } \ No newline at end of file diff --git a/vcpkg.json b/vcpkg/manifest/vcpkg.json similarity index 65% rename from vcpkg.json rename to vcpkg/manifest/vcpkg.json index 0f00ca4d..2f458b09 100644 --- a/vcpkg.json +++ b/vcpkg/manifest/vcpkg.json @@ -3,13 +3,7 @@ "version": "1.4.1", "dependencies": [ "minizip", - { - "name": "icu", - "default-features": false, - "features": [ - "data-archive" - ] - }, + "icu", { "name": "libxml2", "default-features": false @@ -19,11 +13,11 @@ [ { "name": "icu", - "version": "72.1" + "version": "72.1#5" }, { "name": "libxml2", - "version": "2.11.9" + "version": "2.11.9#1" } ], "builtin-baseline": "3c5b9b4ea547898b1ae2d82edbeeda1333c212e9" diff --git a/vcpkg/triplets/arm64-win-static-rel.cmake b/vcpkg/triplets/arm64-win-static-rel.cmake new file mode 100644 index 00000000..75e78df9 --- /dev/null +++ b/vcpkg/triplets/arm64-win-static-rel.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_BUILD_TYPE release) + +set(VCPKG_CONFIGURE_MAKE_OPTIONS "-with-data-packaging=archive") \ No newline at end of file diff --git a/vcpkg/triplets/arm64-win-static.cmake b/vcpkg/triplets/arm64-win-static.cmake new file mode 100644 index 00000000..e1c44716 --- /dev/null +++ b/vcpkg/triplets/arm64-win-static.cmake @@ -0,0 +1,5 @@ +set(VCPKG_TARGET_ARCHITECTURE arm64) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CONFIGURE_MAKE_OPTIONS "-with-data-packaging=archive") \ No newline at end of file diff --git a/vcpkg/triplets/x64-win-static-rel.cmake b/vcpkg/triplets/x64-win-static-rel.cmake new file mode 100644 index 00000000..1ea5cc07 --- /dev/null +++ b/vcpkg/triplets/x64-win-static-rel.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_BUILD_TYPE release) + +set(VCPKG_CONFIGURE_MAKE_OPTIONS "-with-data-packaging=archive") \ No newline at end of file diff --git a/vcpkg/triplets/x64-win-static.cmake b/vcpkg/triplets/x64-win-static.cmake new file mode 100644 index 00000000..a8432ce6 --- /dev/null +++ b/vcpkg/triplets/x64-win-static.cmake @@ -0,0 +1,5 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CONFIGURE_MAKE_OPTIONS "-with-data-packaging=archive") \ No newline at end of file diff --git a/vcpkg/triplets/x86-win-static-rel.cmake b/vcpkg/triplets/x86-win-static-rel.cmake new file mode 100644 index 00000000..6c6ede3e --- /dev/null +++ b/vcpkg/triplets/x86-win-static-rel.cmake @@ -0,0 +1,7 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_BUILD_TYPE release) + +set(VCPKG_CONFIGURE_MAKE_OPTIONS "-with-data-packaging=archive") \ No newline at end of file diff --git a/vcpkg/triplets/x86-win-static.cmake b/vcpkg/triplets/x86-win-static.cmake new file mode 100644 index 00000000..1fba0901 --- /dev/null +++ b/vcpkg/triplets/x86-win-static.cmake @@ -0,0 +1,5 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE static) +set(VCPKG_LIBRARY_LINKAGE static) + +set(VCPKG_CONFIGURE_MAKE_OPTIONS "-with-data-packaging=archive") \ No newline at end of file