forked from ruslo/hunter
-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
5 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
hunter_cacheable(eyalroz_printf) | ||
hunter_download(PACKAGE_NAME eyalroz_printf) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>`__. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } | ||
|
||
# Test double library creation | ||
find_package(printf CONFIG REQUIRED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
|