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

consider a header only release #455

Closed
weegreenblobbie opened this issue Jan 12, 2017 · 6 comments
Closed

consider a header only release #455

weegreenblobbie opened this issue Jan 12, 2017 · 6 comments

Comments

@weegreenblobbie
Copy link

I would love to use this library! I recently started using catch.hpp, a header-only unit test framework.

How hard would it be to create a single header release of fmt?

@amc522
Copy link

amc522 commented Jan 13, 2017

Optional header-only configuration enabled with the FMT_HEADER_ONLY macro.

Last item in the features list in the README

@weegreenblobbie
Copy link
Author

Nice! So I need to download and build the header only configuration? Or do I save all the code and then define the macro in my build system?

@amc522
Copy link

amc522 commented Jan 13, 2017

I've never used cmake to build the header, but a quick scan through looks like it does generate one header if the cmake version is greater than or equal to 3.1.0. I've personally just included all the *.h and *.c files in my source and just globally defined FMT_HEADER_ONLY.

@weegreenblobbie
Copy link
Author

Thanks, I'll give building into single header a try.

@weegreenblobbie
Copy link
Author

Well, cmake won't build a single header file, it looks like catch.hpp wrote some custom .py scripts to glob them all together into a single header. Would that be something this project would be interested in? I may contribute a pull request if so.

@weegreenblobbie
Copy link
Author

I decided to just do this instead. Download the library, then write my own fmt.hpp with this:

// https://github.com/fmtlib/fmt

#ifndef _FMT_HPP_
#define _FMT_HPP_

#ifndef FMT_HEADER_ONLY
    #define FMT_HEADER_ONLY
#endif

#include <fmt/format.h>

#endif // _FMT_HPP_
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants