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

Switch to a CMake-based build #106

Open
eyalroz opened this issue Jun 28, 2021 · 4 comments
Open

Switch to a CMake-based build #106

eyalroz opened this issue Jun 28, 2021 · 4 comments

Comments

@eyalroz
Copy link

eyalroz commented Jun 28, 2021

Instead of a Makefile which makes several assumptions it doesn't need to, consider basing the build on the CMake build system generator. This will allow:

  • A convenient interface for setting compilation options (e.g. support floats or not, buffer sizes)
  • Conditionally building tests
  • Better cross-platform and cross-development environment compatibility
  • A mechanism for installing the library as a package
eyalroz referenced this issue in eyalroz/printf Jun 28, 2021
Caveat: Doesn't support the `--coverage` linking option, used in the original `Makefile`, explicitly
eyalroz referenced this issue in eyalroz/printf Jun 28, 2021
Caveat: Doesn't support the `--coverage` linking option, used in the original `Makefile`, explicitly
eyalroz referenced this issue in eyalroz/printf Jun 28, 2021
Caveat: Doesn't support the `--coverage` linking option, used in the original `Makefile`, explicitly
eyalroz referenced this issue in eyalroz/printf Jun 28, 2021
Caveat: Doesn't support the `--coverage` linking option, used in the original `Makefile`, explicitly
@ledvinap
Copy link

This project is intended to be included in other projects, it is not build as library. Using CMake for unittest is fine, but compilation options may cause problems when other 'outer' build system is used ...

@eyalroz
Copy link
Author

eyalroz commented Jun 30, 2021

@ledvinap : CMake is even better for use in other projects, and I've included a mechanism for installing and exporting. Also, you can always create a Makefile using CMake, if you really like Makefiles for some reason. And Makefile's suffer from the same problem, even worse: For example, Windows people don't use Makefile, while with CMake you can generate MSVS projects, or nmake scripts, or whatever you like. Same goes for other platforms.

Also, if someone wants to just use the two source files (printf.h and printf.c), they can do that regardless.

But - if there's a usage scenario I've missed, please elaborate...

@ledvinap
Copy link

It should be fine as long as print.[ch] is not dependent on CMake use ..

@eyalroz
Copy link
Author

eyalroz commented Jun 30, 2021

@ledvinap : These two files continue to exist as is... if you'll look at the commit, you'll see the only changes are additions of CMakeLists.txt files and removal of the Makefile.

eyalroz referenced this issue in eyalroz/printf Jul 1, 2021
…sured all relevant numeric fields actually get numbers. Removed some commented-out code.
eyalroz referenced this issue in eyalroz/printf Jul 1, 2021
…sured all relevant numeric fields actually get numbers. Removed some commented-out code.
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