ned14 / outcome

Provides very lightweight outcome<T> and result<T> (non-Boost edition)
https://ned14.github.io/outcome
Other
675 stars 62 forks source link

Build builds tests by default #285

Closed yurivict closed 11 months ago

yurivict commented 11 months ago

It builds test/tests/core-outcome.cpp and many other tests.

By default it should build only the main library, and there should be a special option that enables tests. This is because package builds don't need tests to be built to save CPU resources.

Could you please make all tests be conditional on a special cmake variable, like cmake's standard BUILD_TESTING?

Thank you.

BurningEnlightenment commented 11 months ago

IIRC PROJECT_IS_DEPENDENCY=ON ought to disable the test suite. However, I also faintly remember something wrt this not working due to shadowing the cache value of said variable during quickcpplib bootstrapping... Have you looked at the vcpkg port config options? https://github.com/microsoft/vcpkg/blob/a6657c38d506872a735f444159f31887791b07d3/ports/outcome/portfile.cmake#L42-L48

Furthermore, I consider that the buildsystem must be rewritten¹.

ned14 commented 11 months ago

BUILD_TESTING is now respected. PROJECT_DEPENDENCY is now ${PROJECT_NAME}_DEPENDENCY.