Use of std::optional breaks build on GCC 6.3.0 (and others)
Issue type
Bug report
Description
std::optional is a C++17 feature and not available on all compilers. Its use mandates a very recent compiler, but the cmake configuration doesn't error out.
Steps to reproduce and other useful info
Checkout commit a0dce77 or anything newer. Attempt to build. If your GCC is new enough to claim to support (some of) C++17, but not new enough to be able to #include
Technical information
- Operating System : Debian GNU/Linux 9.12
- OBS Studio version : 25.0.7
Development Environment
gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516 (Also tested on gcc from Debian Buster but I don't have a version string for that - same issue though) cmake -DLIBOBS_INCLUDE_DIR=/home/rosuav/obs-studio/libobs -DCMAKE_INSTALL_PREFIX=/usr ..
Cannot reproduce on GCC 8.3.0 on Debian Buster 10.4. Build just worked without issues.
OBS-Studio requires C++17, as such it would not be reasonable to continue to support compilers without c++17 functionality.
But if it's not supported, the cmake setup should detect this and prevent it. It should error out during the configuration, NOT during the build afterwards. That's the whole point of the configure step.
I agree with @Rosuav .... and I don't believe OBS requires C++17, because I've build it just fine on Debian 9:
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0