2021-03-31 01:17:02 +08:00
|
|
|
# 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.
|
|
|
|
|
2022-05-18 02:15:06 +08:00
|
|
|
include("${CURRENT_PORT_DIR}/sha_manifest.cmake")
|
2021-03-31 01:17:02 +08:00
|
|
|
|
2022-07-09 05:05:39 +08:00
|
|
|
vcpkg_check_features(
|
|
|
|
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
|
|
|
INVERTED_FEATURES
|
|
|
|
polyfill-cxx17 QUICKCPPLIB_REQUIRE_CXX17
|
|
|
|
polyfill-cxx20 QUICKCPPLIB_REQUIRE_CXX20
|
|
|
|
)
|
|
|
|
|
|
|
|
if (NOT QUICKCPPLIB_REQUIRE_CXX20)
|
2022-01-19 07:58:04 +08:00
|
|
|
message(WARNING [=[
|
2022-07-09 05:05:39 +08:00
|
|
|
QuickCppLib and its downstream dependencies Outcome and LLFIO were tested against span-lite version 0.10.3 and byte-lite version 0.3.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:
|
2022-01-19 07:58:04 +08:00
|
|
|
"overrides": [
|
2022-07-09 05:05:39 +08:00
|
|
|
{ "name": "span-lite", "version": "0.10.3" },
|
2022-01-19 07:58:04 +08:00
|
|
|
{ "name": "byte-lite", "version": "0.3.0" }
|
|
|
|
]
|
|
|
|
Do not report issues to upstream without first pinning these previous versions.
|
|
|
|
]=])
|
|
|
|
endif()
|
2021-03-31 01:17:02 +08:00
|
|
|
|
|
|
|
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
|
2022-07-09 05:05:39 +08:00
|
|
|
if (NOT QUICKCPPLIB_REQUIRE_CXX17)
|
2022-01-19 07:58:04 +08:00
|
|
|
file(COPY "${CURRENT_INSTALLED_DIR}/include/nonstd/byte.hpp"
|
|
|
|
DESTINATION "${SOURCE_PATH}/include/quickcpplib/byte/include/nonstd")
|
|
|
|
endif()
|
2022-07-09 05:05:39 +08:00
|
|
|
if (NOT QUICKCPPLIB_REQUIRE_CXX20)
|
|
|
|
file(COPY "${CURRENT_INSTALLED_DIR}/include/nonstd/span.hpp"
|
|
|
|
DESTINATION "${SOURCE_PATH}/include/quickcpplib/span-lite/include/nonstd")
|
2022-01-19 07:58:04 +08:00
|
|
|
endif()
|
2021-03-31 01:17:02 +08:00
|
|
|
|
|
|
|
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.
|
2022-01-19 07:58:04 +08:00
|
|
|
vcpkg_cmake_configure(
|
2021-03-31 01:17:02 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
-DPROJECT_IS_DEPENDENCY=On
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Git=ON
|
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON
|
2022-01-19 07:58:04 +08:00
|
|
|
-DCMAKE_INSTALL_DATADIR=${CURRENT_PACKAGES_DIR}/share/ned14-internal-quickcpplib
|
|
|
|
${FEATURE_OPTIONS}
|
|
|
|
MAYBE_UNUSED_VARIABLES
|
|
|
|
CMAKE_DISABLE_FIND_PACKAGE_Doxygen
|
2021-03-31 01:17:02 +08:00
|
|
|
)
|
|
|
|
|
2022-01-19 07:58:04 +08:00
|
|
|
vcpkg_cmake_install()
|
2021-03-31 01:17:02 +08:00
|
|
|
|
2022-07-09 05:05:39 +08:00
|
|
|
if (QUICKCPPLIB_REQUIRE_CXX17)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quickcpplib/byte.hpp" "#if QUICKCPPLIB_USE_STD_BYTE" "#if 1")
|
|
|
|
else ()
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quickcpplib/byte.hpp" "#if QUICKCPPLIB_USE_STD_BYTE" "#if 0")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quickcpplib/byte.hpp" "#include \"byte/include/nonstd/byte.hpp\"" "#include <nonstd/byte.hpp>")
|
|
|
|
endif()
|
|
|
|
if (QUICKCPPLIB_REQUIRE_CXX20)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quickcpplib/span.hpp" "#ifdef QUICKCPPLIB_USE_STD_SPAN" "#if 1")
|
|
|
|
else ()
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quickcpplib/span.hpp" "#ifdef QUICKCPPLIB_USE_STD_SPAN" "#if 0")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quickcpplib/span.hpp" "#elif(_HAS_CXX20 || __cplusplus >= 202002) && __has_include(<span>)" "#elif 0")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/quickcpplib/span.hpp" "#include \"span-lite/include/nonstd/span.hpp\"" "#include <nonstd/span.hpp>")
|
|
|
|
endif()
|
|
|
|
|
2022-01-19 07:58:04 +08:00
|
|
|
vcpkg_cmake_config_fixup(
|
|
|
|
PACKAGE_NAME quickcpplib
|
|
|
|
CONFIG_PATH lib/cmake/quickcpplib
|
|
|
|
)
|
2021-03-31 01:17:02 +08:00
|
|
|
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")
|
|
|
|
|
|
|
|
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)
|