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

eyalroz_printf: Add version 6.2.0 #725

Merged
merged 6 commits into from
Jul 21, 2024
Merged
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 @@ -281,6 +281,7 @@ hunter_default_version(eos VERSION 0.12.1)
hunter_default_version(etc2comp VERSION 0.0.0-9cd0f9c-p0)
hunter_default_version(ethash VERSION 1.0.0)
hunter_default_version(eventpp VERSION 0.1.2-for-hunter-pm)
hunter_default_version(eyalroz_printf VERSION 6.2.0)
hunter_default_version(farmhash VERSION 1.1)
hunter_default_version(fast_obj VERSION 1.1-9255172-p0)
hunter_default_version(ffmpeg VERSION n4.1-dev-45499e557c-p7)
Expand Down
29 changes: 29 additions & 0 deletions cmake/projects/eyalroz_printf/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright (c) 2024 Eyal Rozenberg <[email protected]>
# Copyright (c) 2024 Alexander Voronov <[email protected]>
# 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)

hunter_add_version(
PACKAGE_NAME eyalroz_printf
VERSION "6.2.0"
URL "https://github.com/eyalroz/printf/archive/refs/tags/v6.2.0.zip"
SHA1 f60ce53b0d47e1ff0c4f54cd702a71eec362ffc6
)

hunter_cmake_args(
eyalroz_printf
CMAKE_ARGS
BUILD_TESTS=OFF
)

hunter_pick_scheme(DEFAULT url_sha1_cmake)
crvux marked this conversation as resolved.
Show resolved Hide resolved
hunter_cacheable(eyalroz_printf)
hunter_download(PACKAGE_NAME eyalroz_printf)

42 changes: 42 additions & 0 deletions docs/packages/pkg/eyalroz_printf.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.. spelling::

eyalroz
printf

.. index:: logging ; eyalroz_printf

.. _pkg.eyalroz_printf:

eyalroz_printf
==============

- `Official <https://github.com/eyalroz/printf>`__
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/eyalroz_printf/CMakeLists.txt>`__
- Added by `Alexander Voronov <https://github.com/crvux>`__ (`pr-725 <https://github.com/cpp-pm/hunter/pull/725>`__)


.. literalinclude:: /../examples/eyalroz_printf/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }

CMake options
-------------

The ``CMAKE_ARGS`` feature (see
`customization <https://hunter.readthedocs.io/en/latest/reference/user-modules/hunter_config.html>`__)
can be used to customize package:

- For example, to build static library:

.. code-block:: cmake

hunter_config(
eyalroz_printf
VERSION ${HUNTER_eyalroz_printf_VERSION}
CMAKE_ARGS
BUILD_SHARED_LIBS=OFF
)

For more options see `original repository <https://github.com/eyalroz/printf/blob/master/CMakeLists.txt>`__.

22 changes: 22 additions & 0 deletions examples/eyalroz_printf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2024 Eyal Rozenberg <[email protected]>
# Copyright (c) 2024 Alexander Voronov <[email protected]>
# All rights reserved.

cmake_minimum_required(VERSION 3.5)

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(download-eyalroz_printf)

# DOCUMENTATION_START {
hunter_add_package(eyalroz_printf)
find_package(printf CONFIG REQUIRED)

add_executable(main main.c)
target_link_libraries(main PUBLIC printf::printf)
# DOCUMENTATION_END }
crvux marked this conversation as resolved.
Show resolved Hide resolved

# Test double library creation
find_package(printf CONFIG REQUIRED)
12 changes: 12 additions & 0 deletions examples/eyalroz_printf/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <stdio.h>
#include <printf/printf.h>

void putchar_(char c) {
putchar(c);
}

int main() {
printf_("%s %d %f\n", "Hello World!", 42, 3.1415);
return 0;
}

Loading