The defaults for STLAB_USE_BOOST_CPP17_SHIMS and STLAB_NO_STD_COROUTINES are OFF and FALSE. This reflects the strategy of assuming newer versions of compilers which has the tradeoff of less complexity in our build system, but more work for those using older compilers.
On the other hand, MacOS users, which represent a large and important portion of our development community, are stuck with a version of XCode that doesn't support coroutines so they frequently run into the stumbling block where builds don't work and STLAB_NO_STD_COROUTINES needs to be explicitly set ON.
This task is to give both of these parameters better defaults by empirically testing whether or not they are needed.
This involves the creation of two functions, stlab_detect_coroutines, and stlab_detect_optional_variant that live in cmake/StlabUtil.cmake. They will utilize check_cxx_source_runs with some simple test files that verify that the functionality works. These functions will be used to produce defaults for STLAB_USE_BOOST_CPP17_SHIMS and STLAB_NO_STD_COROUTINES in the same way that stlab_detect_thread_system produces a default for STLAB_THREAD_SYSTEM.
Acceptance Criteria
Creation and usage of the functions as described above.
A new CI job that confirms usage of an earlier language version (e.g. 14) produces the appropriate defaults for these parameters.
The removal of the STLAB_NO_STD_COROUTINES=OFF parameter in CI's MacOS job since this will be autodetected.
Some way to confirm in the CI job that coroutines are ON for a compiler that supports it.
The defaults for STLAB_USE_BOOST_CPP17_SHIMS and STLAB_NO_STD_COROUTINES are OFF and FALSE. This reflects the strategy of assuming newer versions of compilers which has the tradeoff of less complexity in our build system, but more work for those using older compilers.
On the other hand, MacOS users, which represent a large and important portion of our development community, are stuck with a version of XCode that doesn't support coroutines so they frequently run into the stumbling block where builds don't work and STLAB_NO_STD_COROUTINES needs to be explicitly set ON.
This task is to give both of these parameters better defaults by empirically testing whether or not they are needed.
This involves the creation of two functions,
stlab_detect_coroutines
, andstlab_detect_optional_variant
that live incmake/StlabUtil.cmake
. They will utilize check_cxx_source_runs with some simple test files that verify that the functionality works. These functions will be used to produce defaults for STLAB_USE_BOOST_CPP17_SHIMS and STLAB_NO_STD_COROUTINES in the same way that stlab_detect_thread_system produces a default for STLAB_THREAD_SYSTEM.Acceptance Criteria