Skip to content
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

FEEDBACK REQUESTED Testing ideas for how to add QuickCppLib to cpp-pm in preparation for adding Outcome and LLFIO #499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
30 changes: 30 additions & 0 deletions cmake/projects/ned14-internal-quickcpplib/hunter.cmake
Original file line number Diff line number Diff line change
@@ -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)
23 changes: 23 additions & 0 deletions docs/packages/pkg/ned14-internal-quickcpplib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.. spelling::

QuickCppLib
quickcpplib
ned14-internal-quickcpplib

.. _pkg.ned14-internal-quickcpplib:

ned14-internal-quickcpplib
==========================

- `Official <https://github.com/ned14/quickcpplib>`__

.. code-block:: cmake

find_package(Threads REQUIRED)
hunter_add_package(ned14-internal-quickcpplib)
find_package(quickcpplib CONFIG REQUIRED)
target_link_libraries(... quickcpplib::hl Threads::Threads)

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.
17 changes: 17 additions & 0 deletions examples/ned14-internal-quickcpplib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# 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)
find_package(Threads REQUIRED)

hunter_add_package(ned14-internal-quickcpplib)
find_package(quickcpplib CONFIG REQUIRED)

add_executable(foo foo.cpp)
target_link_libraries(foo PUBLIC quickcpplib::hl Threads::Threads)
9 changes: 9 additions & 0 deletions examples/ned14-internal-quickcpplib/foo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include <quickcpplib/byte.hpp>
#include <quickcpplib/signal_guard.hpp>

int main() {
using namespace QUICKCPPLIB_NAMESPACE::signal_guard;
signal_guard_install i(signalc_set::segmentation_fault | signalc_set::cxx_termination);
(void) i;
return 0;
}