Skip to content

Commit 2f3cf77

Browse files
authored
eyalroz_printf: Add version 6.2.0 (#725)
* eyalroz_printf: Add version 6.2.0 A package for a library that provides a custom printf implementation. See https://github.com/eyalroz/printf
1 parent 93329a1 commit 2f3cf77

File tree

5 files changed

+106
-0
lines changed

5 files changed

+106
-0
lines changed

cmake/configs/default.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ hunter_default_version(eos VERSION 0.12.1)
283283
hunter_default_version(etc2comp VERSION 0.0.0-9cd0f9c-p0)
284284
hunter_default_version(ethash VERSION 1.0.0)
285285
hunter_default_version(eventpp VERSION 0.1.2-for-hunter-pm)
286+
hunter_default_version(eyalroz_printf VERSION 6.2.0)
286287
hunter_default_version(farmhash VERSION 1.1)
287288
hunter_default_version(fast_obj VERSION 1.1-9255172-p0)
288289
hunter_default_version(ffmpeg VERSION n4.1-dev-45499e557c-p7)
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (c) 2024 Eyal Rozenberg <[email protected]>
2+
# Copyright (c) 2024 Alexander Voronov <[email protected]>
3+
# All rights reserved.
4+
5+
# !!! DO NOT PLACE HEADER GUARDS HERE !!!
6+
7+
include(hunter_add_version)
8+
include(hunter_cacheable)
9+
include(hunter_cmake_args)
10+
include(hunter_download)
11+
include(hunter_pick_scheme)
12+
13+
hunter_add_version(
14+
PACKAGE_NAME eyalroz_printf
15+
VERSION "6.2.0"
16+
URL "https://github.com/eyalroz/printf/archive/refs/tags/v6.2.0.zip"
17+
SHA1 f60ce53b0d47e1ff0c4f54cd702a71eec362ffc6
18+
)
19+
20+
hunter_cmake_args(
21+
eyalroz_printf
22+
CMAKE_ARGS
23+
BUILD_TESTS=OFF
24+
)
25+
26+
hunter_pick_scheme(DEFAULT url_sha1_cmake)
27+
hunter_cacheable(eyalroz_printf)
28+
hunter_download(PACKAGE_NAME eyalroz_printf)
29+

docs/packages/pkg/eyalroz_printf.rst

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
.. spelling::
2+
3+
eyalroz
4+
printf
5+
6+
.. index:: logging ; eyalroz_printf
7+
8+
.. _pkg.eyalroz_printf:
9+
10+
eyalroz_printf
11+
==============
12+
13+
- `Official <https://github.com/eyalroz/printf>`__
14+
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/eyalroz_printf/CMakeLists.txt>`__
15+
- Added by `Alexander Voronov <https://github.com/crvux>`__ (`pr-725 <https://github.com/cpp-pm/hunter/pull/725>`__)
16+
17+
18+
.. literalinclude:: /../examples/eyalroz_printf/CMakeLists.txt
19+
:language: cmake
20+
:start-after: # DOCUMENTATION_START {
21+
:end-before: # DOCUMENTATION_END }
22+
23+
CMake options
24+
-------------
25+
26+
The ``CMAKE_ARGS`` feature (see
27+
`customization <https://hunter.readthedocs.io/en/latest/reference/user-modules/hunter_config.html>`__)
28+
can be used to customize package:
29+
30+
- For example, to build static library:
31+
32+
.. code-block:: cmake
33+
34+
hunter_config(
35+
eyalroz_printf
36+
VERSION ${HUNTER_eyalroz_printf_VERSION}
37+
CMAKE_ARGS
38+
BUILD_SHARED_LIBS=OFF
39+
)
40+
41+
For more options see `original repository <https://github.com/eyalroz/printf/blob/master/CMakeLists.txt>`__.
42+
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2024 Eyal Rozenberg <[email protected]>
2+
# Copyright (c) 2024 Alexander Voronov <[email protected]>
3+
# All rights reserved.
4+
5+
cmake_minimum_required(VERSION 3.5)
6+
7+
# Emulate HunterGate:
8+
# * https://github.com/hunter-packages/gate
9+
include("../common.cmake")
10+
11+
project(download-eyalroz_printf)
12+
13+
# DOCUMENTATION_START {
14+
hunter_add_package(eyalroz_printf)
15+
find_package(printf CONFIG REQUIRED)
16+
17+
add_executable(main main.c)
18+
target_link_libraries(main PUBLIC printf::printf)
19+
# DOCUMENTATION_END }
20+
21+
# Test double library creation
22+
find_package(printf CONFIG REQUIRED)

examples/eyalroz_printf/main.c

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <stdio.h>
2+
#include <printf/printf.h>
3+
4+
void putchar_(char c) {
5+
putchar(c);
6+
}
7+
8+
int main() {
9+
printf_("%s %d %f\n", "Hello World!", 42, 3.1415);
10+
return 0;
11+
}
12+

0 commit comments

Comments
 (0)