yhirose / cpp-peglib

A single file C++ header-only PEG (Parsing Expression Grammars) library
MIT License
880 stars 112 forks source link

Add cmake toggle to disable tests #219

Closed NotAPenguin0 closed 2 years ago

NotAPenguin0 commented 2 years ago

Building tests by default is not necessary, so I added a cmake option() command PEGLIB_BUILD_TESTS that can be used to toggle this on or off (default value is OFF).

yhirose commented 2 years ago

@NotAPenguin0, thanks for the pull request. Personally, I always want to include the unit testing. Could you please make it ON as default, so that I don't have to specify the additional option all the time?

NotAPenguin0 commented 2 years ago

Added :)

yhirose commented 2 years ago

@NotAPenguin0, another question is, is it a cmake common practice used in other open source projects? I have never made unit test optional in any my projects.

NotAPenguin0 commented 2 years ago

I believe so yeah, the unit tests are mostly for library developers. As a user I prefer not to waste build time compiling and/or running tests. Adding the toggle just adds more flexibility in the end.

yhirose commented 2 years ago

Thanks for the answer!