-
Notifications
You must be signed in to change notification settings - Fork 7.4k
[outcome] Replace Outcome single header based port with full fat cmake install port #15603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
61a814a
Replace Outcome single header based port with full fat cmake install …
ned14 33048bb
[outcome] Improve portfile.cmake
538688b
update baseline
c73a136
Refactor @JackBoosY's changes to make the dependency SHA feature chosen.
ned14 6e1d8a3
update baseline
30881be
Fix outcome features so they actually work.
ned14 05c60d0
update baseline
977ae4f
[outcome] install usage
808a35c
update baseline
1448e0f
[outcome] Always use vcpkg copies of dependencies
ras0219-msft 07ddde4
DO NOT MERGE YET, ONLY FOR INSPECTION BY PR REVIEW.
ned14 93f54ad
Fix all remaining issues, including link failure. This changeset is n…
ned14 62b1704
Update versions.
ned14 f3fc75e
Have LLFIO not build static or shared libs according to VCPKG_LIBRARY…
ned14 38d0df1
Fix last commit breaking everything :)
ned14 75cc4bc
Update versions.
ned14 f6d243a
Disable uwp support for LLFIO.
ned14 31aae15
versions
ned14 72be659
Fix status code on GCC 6 and 7
ned14 779f6f3
Don't download ntkernel-error-category if not on Windows.
ned14 e2fb3cb
Fix status-code on UWP.
ned14 5465177
Update versions.
ned14 49ed336
Fix MSVC on ARM.
ned14 b913997
Apply all the feedback from the PR review, more or less.
ned14 aed2acd
versions
ned14 2e00a6e
Update to latest, disable UWP for Outcome.
ned14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| Source: llfio | ||
| Version: 2.0-a74411ed | ||
| Homepage: https://github.com/ned14/llfio | ||
| Description: P1031 low level file i/o and filesystem library for the C++ standard | ||
| Build-Depends: outcome | ||
| Supports: !(uwp|static) | ||
|
|
||
| Feature: status-code | ||
| Description: Have LLFIO use SG14 `status_code` (proposed `std::error`) instead of `std::error_code`. | ||
|
|
||
| Feature: run-tests | ||
| Description: Build and run the dependency validation tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| message(WARNING [=[ | ||
| LLFIO depends on Outcome which depends on QuickCppLib which uses the vcpkg versions of gsl-lite and byte-lite, rather than the versions tested by QuickCppLib's, Outcome's and LLFIO's CI. It is not guaranteed to work with other versions, with failures experienced in the past up-to-and-including runtime crashes. See the warning message from QuickCppLib for how you can pin the versions of those dependencies in your manifest file to those with which QuickCppLib was tested. Do not report issues to upstream without first pinning the versions as QuickCppLib was tested against. | ||
| ]=]) | ||
|
|
||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO ned14/llfio | ||
| REF a74411eddb6401ab884c5f92cccc24b9a64a9e6f | ||
| SHA512 e0f8b030ac995c24135aae89450f05ad75e5fed10caec254b327f1fc0d4c23eaeb53b7859e5e5b4731ffeace9fdfc75cd04a66025243e7f35c7dea37dc0d1b6c | ||
| HEAD_REF develop | ||
| ) | ||
|
|
||
| if(VCPKG_TARGET_IS_WINDOWS) | ||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH NTKEC_SOURCE_PATH | ||
| REPO ned14/ntkernel-error-category | ||
| REF bbd44623594142155d49bd3ce8820d3cf9da1e1e | ||
| SHA512 589d3bc7bca98ca8d05ce9f5cf009dd98b8884bdf3739582f2f6cbf5a324ce95007ea041450ed935baa4a401b4a0242c181fb6d2dcf7ad91587d75f05491f50e | ||
| HEAD_REF master | ||
| ) | ||
| endif() | ||
|
|
||
| vcpkg_check_features( | ||
| OUT_FEATURE_OPTIONS LLFIO_FEATURE_OPTIONS | ||
| FEATURES | ||
| status-code LLFIO_USE_EXPERIMENTAL_SG14_STATUS_CODE | ||
| ) | ||
|
|
||
| # LLFIO needs a copy of QuickCppLib with which to bootstrap its cmake | ||
| file(COPY "${CURRENT_INSTALLED_DIR}/include/quickcpplib" | ||
| DESTINATION "${SOURCE_PATH}/quickcpplib/repo/include/" | ||
| ) | ||
| file(COPY "${CURRENT_INSTALLED_DIR}/share/ned14-internal-quickcpplib/" | ||
| DESTINATION "${SOURCE_PATH}/quickcpplib/repo/" | ||
| ) | ||
|
|
||
| # LLFIO expects ntkernel-error-category to live inside its include directory | ||
| file(REMOVE_RECURSE "${SOURCE_PATH}/include/llfio/ntkernel-error-category") | ||
| if(VCPKG_TARGET_IS_WINDOWS) | ||
| file(RENAME "${NTKEC_SOURCE_PATH}" "${SOURCE_PATH}/include/llfio/ntkernel-error-category") | ||
| endif() | ||
|
|
||
| # Already installed dependencies don't appear on the include path, which LLFIO assumes. | ||
| string(APPEND VCPKG_CXX_FLAGS " \"-I${CURRENT_INSTALLED_DIR}/include\"") | ||
| string(APPEND VCPKG_C_FLAGS " \"-I${CURRENT_INSTALLED_DIR}/include\"") | ||
|
|
||
| set(extra_config) | ||
| # cmake does not correctly set CMAKE_SYSTEM_PROCESSOR when targeting ARM on Windows | ||
| if(VCPKG_TARGET_IS_WINDOWS AND (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")) | ||
| list(APPEND extra_config -DLLFIO_ASSUME_CROSS_COMPILING=On) | ||
| endif() | ||
|
|
||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH "${SOURCE_PATH}" | ||
| PREFER_NINJA | ||
| OPTIONS | ||
| -DPROJECT_IS_DEPENDENCY=On | ||
| -Dquickcpplib_FOUND=1 | ||
| -Doutcome_FOUND=1 | ||
| ${LLFIO_FEATURE_OPTIONS} | ||
| -DLLFIO_ENABLE_DEPENDENCY_SMOKE_TEST=ON # Leave this always on to test everything compiles | ||
| -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON | ||
| ${extra_config} | ||
| ) | ||
|
|
||
| # LLFIO install assumes that the static library is always built | ||
| vcpkg_build_cmake(TARGET _sl) | ||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") | ||
| vcpkg_build_cmake(TARGET _dl) | ||
| endif() | ||
|
|
||
| if("run-tests" IN_LIST FEATURES) | ||
| vcpkg_build_cmake(TARGET test) | ||
| endif() | ||
|
|
||
| vcpkg_install_cmake() | ||
|
|
||
| vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/llfio) | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") | ||
| if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") | ||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") | ||
| endif() | ||
|
|
||
| if("status-code" IN_LIST FEATURES) | ||
| file(INSTALL "${CURRENT_PORT_DIR}/usage-status-code-${VCPKG_LIBRARY_LINKAGE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
| else() | ||
| file(INSTALL "${CURRENT_PORT_DIR}/usage-error-code-${VCPKG_LIBRARY_LINKAGE}" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") | ||
| endif() | ||
| file(INSTALL "${SOURCE_PATH}/Licence.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| The package llfio provides two CMake targets: | ||
|
|
||
| find_package(llfio CONFIG REQUIRED) | ||
|
|
||
| - If you want the header-only form of LLFIO: | ||
| target_link_libraries(main PUBLIC llfio::hl) | ||
|
|
||
| - If you want the shared library form of LLFIO with shared NT kernel error code category: | ||
| target_link_libraries(main PUBLIC llfio::dl llfio::ntkernel-error-category::dl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| The package llfio provides two CMake targets: | ||
|
|
||
| find_package(llfio CONFIG REQUIRED) | ||
|
|
||
| - If you want the header-only form of LLFIO: | ||
| target_link_libraries(main PUBLIC llfio::hl) | ||
|
|
||
| - If you want the static library form of LLFIO with static NT kernel error code category: | ||
| target_link_libraries(main PUBLIC llfio::sl llfio::ntkernel-error-category::sl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| The package llfio provides two CMake targets: | ||
|
|
||
| find_package(llfio CONFIG REQUIRED) | ||
|
|
||
| - If you want the header-only form of LLFIO: | ||
| target_link_libraries(main PUBLIC llfio::hl) | ||
|
|
||
| - If you want the shared library form of LLFIO: | ||
| target_link_libraries(main PUBLIC llfio::dl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| The package llfio provides two CMake targets: | ||
|
|
||
| find_package(llfio CONFIG REQUIRED) | ||
|
|
||
| - If you want the header-only form of LLFIO: | ||
| target_link_libraries(main PUBLIC llfio::hl) | ||
|
|
||
| - If you want the static library form of LLFIO: | ||
| target_link_libraries(main PUBLIC llfio::sl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Source: ned14-internal-quickcpplib | ||
| Version: 0.0.0-24d92c71 | ||
| Homepage: https://github.com/ned14/quickcpplib | ||
| Description: NOT FOR EXTERNAL CONSUMPTION, a set of internal scripts used by ned14's libraries. | ||
| Build-Depends: byte-lite, gsl-lite |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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}") | ||
ned14 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| file(INSTALL "${SOURCE_PATH}/Licence.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) | ||
29 changes: 29 additions & 0 deletions
29
ports/ned14-internal-quickcpplib/quicklib-depheaders.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| diff --git a/cmake/headers.cmake b/cmake/headers.cmake | ||
| index 1aad359..e5053ed 100644 | ||
| --- a/cmake/headers.cmake | ||
| +++ b/cmake/headers.cmake | ||
| @@ -13,8 +13,6 @@ set(quickcpplib_HEADERS | ||
| "include/quickcpplib/boost/test/unit_test.hpp" | ||
| "include/quickcpplib/byte.hpp" | ||
| "include/quickcpplib/byte/include/nonstd/byte.hpp" | ||
| - "include/quickcpplib/byte/test/byte-main.t.hpp" | ||
| - "include/quickcpplib/byte/test/lest_cpp03.hpp" | ||
| "include/quickcpplib/config.hpp" | ||
| "include/quickcpplib/console_colours.hpp" | ||
| "include/quickcpplib/cpp_feature.h" | ||
| @@ -25,15 +23,8 @@ set(quickcpplib_HEADERS | ||
| "include/quickcpplib/erasure_cast.hpp" | ||
| "include/quickcpplib/execinfo_win64.h" | ||
| "include/quickcpplib/function_ptr.hpp" | ||
| - "include/quickcpplib/gsl-lite/gsl-lite.natvis" | ||
| "include/quickcpplib/gsl-lite/include/gsl-lite/gsl-lite.hpp" | ||
| - "include/quickcpplib/gsl-lite/include/gsl.h" | ||
| - "include/quickcpplib/gsl-lite/include/gsl.hpp" | ||
| - "include/quickcpplib/gsl-lite/include/gsl/gsl-lite-vc6.hpp" | ||
| - "include/quickcpplib/gsl-lite/include/gsl/gsl-lite.h" | ||
| "include/quickcpplib/gsl-lite/include/gsl/gsl-lite.hpp" | ||
| - "include/quickcpplib/gsl-lite/test/gsl-lite.t.hpp" | ||
| - "include/quickcpplib/gsl-lite/test/lest_cpp03.hpp" | ||
| "include/quickcpplib/import.h" | ||
| "include/quickcpplib/in_place_detach_attach.hpp" | ||
| "include/quickcpplib/mem_flush_loads_stores.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| set(QUICKCPPLIB_REF 24d92c71ef5d2200f7e42bc47e6dd59ad6d99fe3) | ||
| set(QUICKCPPLIB_SHA512 9e39237833dea8288fbc5fda4189d971dff76284e3f352c7a0762e71a4bf311f4550fefd0f8926b6d971ca1c62acc3d055af233912de0adb0c6821995b6ce7e7) | ||
|
|
||
| set(OPTIONAL_REF 2b43315458a99fc5de1da6e7bc0ddd364b26d643) | ||
| set(OPTIONAL_SHA512 1952386cd3c7b963861f9634055e1baa4181d398d6f1b068a8a3f411368432bdcd42e47aadfa856584ed9a7c724a1c83369243ccb653e650af5c9155b42a84f4) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| You should NOT DIRECTLY USE quickcpplib in your own libraries! | ||
| It is intended for internal use by ned14's vcpkg libraries only. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,9 @@ | ||
| Source: outcome | ||
| Version: 2.1.3 | ||
| Version: 2.2.0-b9e664fb | ||
| Homepage: https://github.com/ned14/outcome | ||
| Description: Provides very lightweight outcome<T> and result<T> (non-Boost edition) | ||
| Build-Depends: ned14-internal-quickcpplib, status-code | ||
| Supports: !uwp | ||
|
|
||
| Feature: run-tests | ||
| Description: Build and run the dependency validation tests |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| diff --git "a/cmake/headers.cmake" "b/cmake/headers.cmake" | ||
| index 108038d16..bf4807e16 100644 | ||
| --- "a/cmake/headers.cmake" | ||
| +++ "b/cmake/headers.cmake" | ||
| @@ -47,7 +47,6 @@ set(outcome_HEADERS | ||
| "include/outcome/experimental/status-code/include/system_code_from_exception.hpp" | ||
| "include/outcome/experimental/status-code/include/system_error2.hpp" | ||
| "include/outcome/experimental/status-code/include/win32_code.hpp" | ||
| - "include/outcome/experimental/status-code/single-header/system_error2.hpp" | ||
| "include/outcome/experimental/status_outcome.hpp" | ||
| "include/outcome/experimental/status_result.hpp" | ||
| "include/outcome/iostream_support.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,77 @@ | ||
| # header-only library | ||
| # Outcome is composed of other third party libraries: | ||
| # Outcome | ||
| # <= status-code | ||
| # <= quickcpplib | ||
| # <= byte-lite | ||
| # <= gsl-lite | ||
| # <= Optional | ||
| # | ||
| # byte-lite and gsl-lite are in vcpkg, but may not be versions | ||
| # known to be compatible with Outcome. It has occurred in the | ||
| # past that newer versions were severely broken with Outcome. | ||
| # | ||
| # One can fetch an 'all sources' tarball from | ||
| # https://github.com/ned14/outcome/releases which contains | ||
| # the exact copy of those third party libraries known to | ||
| # have passed Outcome's CI process. | ||
|
|
||
| message(WARNING [=[ | ||
| Outcome depends on QuickCppLib which uses the vcpkg versions of gsl-lite and byte-lite, rather than the versions tested by QuickCppLib's and Outcome's CI. It is not guaranteed to work with other versions, with failures experienced in the past up-to-and-including runtime crashes. See the warning message from QuickCppLib for how you can pin the versions of those dependencies in your manifest file to those with which QuickCppLib was tested. Do not report issues to upstream without first pinning the versions as QuickCppLib was tested against. | ||
| ]=]) | ||
|
|
||
| vcpkg_from_github( | ||
| OUT_SOURCE_PATH SOURCE_PATH | ||
| REPO ned14/outcome | ||
| REF 34f3bd55e2bcaf246cb79efe64a5600e89b91b66 #v2.1.3 | ||
| SHA512 83eba50e2095e7c768dacb3af5f82db117c3451f1d5bc2f73d716608d56f7b73006ec33d0f3842fdefd076f0e82b72ece5777868712f75e83eac93aa8adf351c | ||
| REF all_tests_passed_b9e664fbf87a4122731f7f19590abad24f1448b8 | ||
| SHA512 50666de7c6fed8260780a3bbd97eb8c8a27cf02541f15a19c316ddef30eafce155817ea8d77efee0180dbd07ad5da06a888275c324a554e25d5ce6bb80666071 | ||
| HEAD_REF develop | ||
| PATCHES | ||
| outcome-prune-sources.patch | ||
| ) | ||
|
|
||
| # Outcome needs a copy of QuickCppLib with which to bootstrap its cmake | ||
| file(COPY "${CURRENT_INSTALLED_DIR}/include/quickcpplib" | ||
| DESTINATION "${SOURCE_PATH}/quickcpplib/repo/include/" | ||
| ) | ||
| file(COPY "${CURRENT_INSTALLED_DIR}/share/ned14-internal-quickcpplib/" | ||
| DESTINATION "${SOURCE_PATH}/quickcpplib/repo/" | ||
| ) | ||
|
|
||
| # Outcome expects status-code to live inside its include directory | ||
| file(COPY "${CURRENT_INSTALLED_DIR}/include/status-code/" | ||
| DESTINATION "${SOURCE_PATH}/include/outcome/experimental/status-code/include/" | ||
| ) | ||
| file(COPY "${CURRENT_INSTALLED_DIR}/include/status-code/detail/" | ||
| DESTINATION "${SOURCE_PATH}/include/outcome/experimental/status-code/include/detail/" | ||
| ) | ||
|
|
||
ned14 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| file(GLOB_RECURSE OUTCOME_HEADERS "${SOURCE_PATH}/single-header/*.hpp") | ||
| file(INSTALL ${OUTCOME_HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include) | ||
| # Because outcome's deployed files are header-only, the debug build is not necessary | ||
| set(VCPKG_BUILD_TYPE release) | ||
|
|
||
| # Already installed dependencies don't appear on the include path, which Outcome assumes. | ||
| string(APPEND VCPKG_CXX_FLAGS " \"-I${CURRENT_INSTALLED_DIR}/include\"") | ||
| string(APPEND VCPKG_C_FLAGS " \"-I${CURRENT_INSTALLED_DIR}/include\"") | ||
|
|
||
| # Use Outcome's own build process, skipping examples and tests. | ||
| vcpkg_configure_cmake( | ||
| SOURCE_PATH "${SOURCE_PATH}" | ||
| PREFER_NINJA | ||
| OPTIONS | ||
| -DPROJECT_IS_DEPENDENCY=On | ||
| -Dquickcpplib_FOUND=1 | ||
| -DOUTCOME_ENABLE_DEPENDENCY_SMOKE_TEST=ON # Leave this always on to test everything compiles | ||
| -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON | ||
| ) | ||
|
|
||
| if("run-tests" IN_LIST FEATURES) | ||
| vcpkg_build_cmake(TARGET test) | ||
| endif() | ||
|
|
||
| vcpkg_install_cmake() | ||
|
|
||
| vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/outcome) | ||
|
|
||
| file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib") | ||
|
|
||
| file(INSTALL ${SOURCE_PATH}/Licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) | ||
| 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) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| The package outcome provides CMake targets: | ||
|
|
||
| find_package(outcome CONFIG REQUIRED) | ||
| target_link_libraries(main PUBLIC outcome::hl) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Source: status-code | ||
| Version: 1.0.0-ab3cd821 | ||
| Homepage: https://github.com/ned14/status-code | ||
| Description: Proposed SG14 status_code for the C++ standard (https://wg21.link/P1028). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure if this is the correct fix, however vcpkg ports must produce only one variant (static/shared) of libraries. The variant requested by the user is defined by
VCPKG_LIBRARY_LINKAGE.vcpkg_configure_cmake()will also automatically define the standard CMake variable for requesting only one flavor:BUILD_SHARED_LIBS(https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you've probably noticed, none of my libraries observe
BUILD_SHARED_LIBS, they always generate targets for header only, static, and shared libraries (and indeed entire target trees for each of the sanitisers and static analysers for each of those again). LLFIO very strongly encourages the static library build over all others, and everything assumes it is always built, because it always is. All target trees generate uniquely named files, nothing ever collides, so apart from it taking slightly longer it is benign.