For implementing std::execution::par, gcc relies on the TBB library. On systems without TBB installed it falls back to the non-parallel implementation, but as soon as the TBB header is available it will try to use it and require linking against TBB.
https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/include/bits/c%2B%2Bconfig#L874-L882 Since TBB is a bigger dependency, making it a required dependency is not an option, so this introduces the option ENABLE_TBB which by default is off but can be used to add the dependency.
The alternative would be to add TBB as a non-required dependency and only add the linker flag if it is found, following the approach from gcc. Would be one less cmake option but I think having it explicit is better allow reproduction between different systems.
For implementing std::execution::par, gcc relies on the TBB library. On systems without TBB installed it falls back to the non-parallel implementation, but as soon as the TBB header is available it will try to use it and require linking against TBB. https://github.com/gcc-mirror/gcc/blob/releases/gcc-14.1.0/libstdc%2B%2B-v3/include/bits/c%2B%2Bconfig#L874-L882 Since TBB is a bigger dependency, making it a required dependency is not an option, so this introduces the option ENABLE_TBB which by default is off but can be used to add the dependency.
The alternative would be to add TBB as a non-required dependency and only add the linker flag if it is found, following the approach from gcc. Would be one less cmake option but I think having it explicit is better allow reproduction between different systems.
fixes #361