Release build fail on FreeBSD
Description of the issue
The building of biboumi under FreeBSD doesn't work when using Release build mode. It works well with Debug build mode.
I've tested on FreeBSD 12.1, using the compiler from the base system (clang++ 8.0.1).
Relevant debug logs
The cmake command:
cmake . -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DWITH_BOTAN=1 -DWITH_UDNS=1 -DWITHOUT_SYSTEMD=1 -DWITH_LIBIDN=1 -DWITH_SQLITE3=1 -WITH_POSTGRESQL=1
The following message is returned by the linker when launching make:
[100%] Linking CXX executable biboumi
ld: error: undefined symbol: std::__1::basic_ostream<char, std::__1::char_traits<char> >& std::__1::operator<<<char, std::__1::char_traits<char>, std::__1::allocator<char> >(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by optional_bool.cpp
>>> CMakeFiles/utils.dir/src/utils/optional_bool.cpp.o:(operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, OptionalBool const&))
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Solution
Including iostream in the src/utils/optional_bool.hpp
file fix it :
#include <iostream>