From 3a6106666ebea8920ad94d225d2d40d08b264ade Mon Sep 17 00:00:00 2001 From: "Niall Douglas (s [underscore] sourceforge {at} nedprod [dot] com)" Date: Tue, 7 Dec 2021 15:59:43 +0000 Subject: [PATCH] Add ned14-internal-quickcpplib in preparation for Outcome and then LLFIO. --- cmake/configs/default.cmake | 1 + .../ned14-internal-quickcpplib/hunter.cmake | 30 +++++++++++++++++++ .../pkg/ned14-internal-quickcpplib.rst | 22 ++++++++++++++ .../ned14-internal-quickcpplib/CMakeLists.txt | 19 ++++++++++++ examples/ned14-internal-quickcpplib/foo.cpp | 9 ++++++ 5 files changed, 81 insertions(+) create mode 100644 cmake/projects/ned14-internal-quickcpplib/hunter.cmake create mode 100644 docs/packages/pkg/ned14-internal-quickcpplib.rst create mode 100644 examples/ned14-internal-quickcpplib/CMakeLists.txt create mode 100644 examples/ned14-internal-quickcpplib/foo.cpp diff --git a/cmake/configs/default.cmake b/cmake/configs/default.cmake index e3f130c7b6..4e12dcd2d0 100644 --- a/cmake/configs/default.cmake +++ b/cmake/configs/default.cmake @@ -401,6 +401,7 @@ hunter_default_version(nanoflann VERSION 1.2.3-p0) hunter_default_version(nanosvg VERSION 0.0.0-2b08dee-p0) hunter_default_version(ncnn VERSION 20180314-p2) hunter_default_version(ncursesw VERSION 6.1) +hunter_default_version(ned14-internal-quickcpplib VERSION 0.0.0-ef0fe8ec) hunter_default_version(nlohmann_fifo_map VERSION 0.0.0-0dfbf5d-p1) hunter_default_version(nlohmann_json VERSION 3.8.0) hunter_default_version(nng VERSION 1.1.1) diff --git a/cmake/projects/ned14-internal-quickcpplib/hunter.cmake b/cmake/projects/ned14-internal-quickcpplib/hunter.cmake new file mode 100644 index 0000000000..a3d1484ceb --- /dev/null +++ b/cmake/projects/ned14-internal-quickcpplib/hunter.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2021 Niall Douglas https://www.nedproductions.biz/ +# All rights reserved. + +# !!! DO NOT PLACE HEADER GUARDS HERE !!! + +include(hunter_add_version) +include(hunter_cacheable) +include(hunter_cmake_args) +include(hunter_download) +include(hunter_pick_scheme) +include(hunter_source_subdir) + +hunter_add_version( + PACKAGE_NAME + ned14-internal-quickcpplib + VERSION + 0.0.0-ef0fe8ec + URL + "https://github.com/ned14/quickcpplib/archive/ef0fe8ecf9951717b63b27447ddcaf5cc8eed6e2.tar.gz" + SHA1 + 3a36f46f4e03893d908894aa7e6d78f7ab1fe0bf +) + +hunter_cmake_args(ned14-internal-quickcpplib CMAKE_ARGS + PROJECT_IS_DEPENDENCY=ON +) + +hunter_pick_scheme(DEFAULT url_sha1_cmake) +hunter_cacheable(ned14-internal-quickcpplib) +hunter_download(PACKAGE_NAME ned14-internal-quickcpplib) diff --git a/docs/packages/pkg/ned14-internal-quickcpplib.rst b/docs/packages/pkg/ned14-internal-quickcpplib.rst new file mode 100644 index 0000000000..9334ab1451 --- /dev/null +++ b/docs/packages/pkg/ned14-internal-quickcpplib.rst @@ -0,0 +1,22 @@ +.. spelling:: + + QuickCppLib + quickcpplib + ned14-internal-quickcpplib + +.. _pkg.ned14-internal-quickcpplib: + +ned14-internal-quickcpplib +========================== + +- `Official `__ + +.. code-block:: cmake + + hunter_add_package(ned14-internal-quickcpplib) + find_package(quickcpplib CONFIG REQUIRED) + target_link_libraries(... quickcpplib::hl) + +QuickCppLib is an internal dependency automatically retrieved by Outcome +and LLFIO and is only present here to ensure exactly reproducible builds. +Do not use it in your own projects. diff --git a/examples/ned14-internal-quickcpplib/CMakeLists.txt b/examples/ned14-internal-quickcpplib/CMakeLists.txt new file mode 100644 index 0000000000..ac283689bd --- /dev/null +++ b/examples/ned14-internal-quickcpplib/CMakeLists.txt @@ -0,0 +1,19 @@ +# Copyright (c) 2021 Niall Douglas +# All rights reserved. + +cmake_minimum_required(VERSION 3.0) + +# Emulate HunterGate: +# * https://github.com/cpp-pm/gate +include("../common.cmake") + +project(download-ned14-internal-quickcpplib) + +hunter_add_package(ned14-internal-quickcpplib) +find_package(quickcpplib CONFIG REQUIRED) + +add_executable(foo-static foo.cpp) +target_link_libraries(foo-static PUBLIC quickcpplib::hl) + +add_executable(foo-shared foo.cpp) +target_link_libraries(foo-shared PUBLIC quickcpplib::hl) diff --git a/examples/ned14-internal-quickcpplib/foo.cpp b/examples/ned14-internal-quickcpplib/foo.cpp new file mode 100644 index 0000000000..708cf5300f --- /dev/null +++ b/examples/ned14-internal-quickcpplib/foo.cpp @@ -0,0 +1,9 @@ +#include +#include + +int main() { + using namespace QUICKCPPLIB_NAMESPACE::signal_guard; + signal_guard_install i(signalc_set::segmentation_fault | signalc_set::cxx_termination); + (void) i; + return 0; +}