aboutsummaryrefslogtreecommitdiff
path: root/ports/ned14-internal-quickcpplib/portfile.cmake
diff options
context:
space:
mode:
authorNiall Douglas <s_github@nedprod.com>2021-03-30 18:17:02 +0100
committerGitHub <noreply@github.com>2021-03-30 10:17:02 -0700
commita434cc74ea515e6612bcb66d8f4ab69bbb8c62bf (patch)
treef407f5a9d737aade2b1a4fd95fe4ea0c986a77c3 /ports/ned14-internal-quickcpplib/portfile.cmake
parent105456798402aa5f494ffeb3b19dd0d870656d39 (diff)
downloadvcpkg-a434cc74ea515e6612bcb66d8f4ab69bbb8c62bf.tar.gz
vcpkg-a434cc74ea515e6612bcb66d8f4ab69bbb8c62bf.zip
[outcome] Replace Outcome single header based port with full fat cmake install port (#15603)
* Replace Outcome single header based port with full fat cmake install port. * [outcome] Improve portfile.cmake * update baseline * Refactor @JackBoosY's changes to make the dependency SHA feature chosen. * update baseline * Fix outcome features so they actually work. * update baseline * [outcome] install usage * update baseline * [outcome] Always use vcpkg copies of dependencies * DO NOT MERGE YET, ONLY FOR INSPECTION BY PR REVIEW. 1. Break out these dependencies into standalone ports: - ned14-internal-quickcpplib - status-code 2. Add port for LLFIO. 3. Add dependency smoke tests for Outcome and LLFIO as per instructions. * Fix all remaining issues, including link failure. This changeset is now ready to merge into vcpkg. * Update versions. * Have LLFIO not build static or shared libs according to VCPKG_LIBRARY_LINKAGE. * Fix last commit breaking everything :) * Update versions. * Disable uwp support for LLFIO. * versions * Fix status code on GCC 6 and 7 * Don't download ntkernel-error-category if not on Windows. * Fix status-code on UWP. * Update versions. * Fix MSVC on ARM. * Apply all the feedback from the PR review, more or less. * versions * Update to latest, disable UWP for Outcome. Co-authored-by: JackBoosY <yuzaiyang@beyondsoft.com> Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'ports/ned14-internal-quickcpplib/portfile.cmake')
-rw-r--r--ports/ned14-internal-quickcpplib/portfile.cmake74
1 files changed, 74 insertions, 0 deletions
diff --git a/ports/ned14-internal-quickcpplib/portfile.cmake b/ports/ned14-internal-quickcpplib/portfile.cmake
new file mode 100644
index 000000000..57cb70c7f
--- /dev/null
+++ b/ports/ned14-internal-quickcpplib/portfile.cmake
@@ -0,0 +1,74 @@
+# QuickCppLib is composed of other third party libraries:
+# <= quickcpplib
+# <= byte-lite
+# <= gsl-lite
+# <= Optional
+#
+# byte-lite and gsl-lite are in vcpkg, but may not be versions
+# known to be compatible with QuickCppLib. It has occurred in the
+# past that newer versions were severely broken with QuickCppLib.
+
+include(${CURRENT_PORT_DIR}/sha_manifest.cmake)
+
+message(WARNING [=[
+QuickCppLib and its downstream dependencies Outcome and LLFIO were tested against gsl-lite version 0.37.0 and byte-lite version 0.2.0. They are not guaranteed to work with newer versions, with failures experienced in the past up-to-and-including runtime crashes. You can pin the versions as verified to work in QuickCppLib's CI in your manifest file by adding:
+ "overrides": [
+ { "name": "gsl-lite", "version": "0.37.0" },
+ { "name": "byte-lite", "version": "0.2.0" }
+ ]
+Do not report issues to upstream without first pinning these previous versions.
+]=])
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO ned14/quickcpplib
+ REF ${QUICKCPPLIB_REF}
+ SHA512 ${QUICKCPPLIB_SHA512}
+ HEAD_REF master
+ PATCHES
+ quicklib-depheaders.patch
+)
+
+# Quickcpplib deploys subsets of the dependency headers into a private subdirectory
+file(COPY "${CURRENT_INSTALLED_DIR}/include/nonstd/byte.hpp"
+ DESTINATION "${SOURCE_PATH}/include/quickcpplib/byte/include/nonstd")
+file(COPY "${CURRENT_INSTALLED_DIR}/include/gsl/gsl-lite.hpp"
+ DESTINATION "${SOURCE_PATH}/include/quickcpplib/gsl-lite/include/gsl")
+file(COPY "${CURRENT_INSTALLED_DIR}/include/gsl-lite/gsl-lite.hpp"
+ DESTINATION "${SOURCE_PATH}/include/quickcpplib/gsl-lite/include/gsl-lite")
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH OPT_SOURCE_PATH
+ REPO akrzemi1/Optional
+ REF ${OPTIONAL_REF}
+ SHA512 ${OPTIONAL_SHA512}
+ HEAD_REF master
+)
+
+file(COPY "${OPT_SOURCE_PATH}/." DESTINATION "${SOURCE_PATH}/include/quickcpplib/optional")
+
+# Because quickcpplib's deployed files are header-only, the debug build it not necessary
+set(VCPKG_BUILD_TYPE release)
+
+# Use QuickCppLib's own build process, skipping examples and tests.
+vcpkg_configure_cmake(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PREFER_NINJA
+ OPTIONS
+ -DPROJECT_IS_DEPENDENCY=On
+ -DQUICKCPPLIB_USE_VCPKG_BYTE_LITE=ON
+ -DQUICKCPPLIB_USE_VCPKG_GSL_LITE=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/quickcpplib)
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/cmakelib" "${CURRENT_PACKAGES_DIR}/share/ned14-internal-quickcpplib/cmakelib")
+file(RENAME "${CURRENT_PACKAGES_DIR}/share/scripts" "${CURRENT_PACKAGES_DIR}/share/ned14-internal-quickcpplib/scripts")
+
+file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+file(INSTALL "${SOURCE_PATH}/Licence.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)