You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CMake build currently fails to compile on macOS (with AppleClang 10.0.0).
Doctest 2.2.2 / 2.3 or newer requires C++11 or newer, at least in the default configuration.
The default C++ compiler standard depends largely on the current toolchain / compiler version. Therefore, it would be much more robust to describe this requirement.
WORKAROUND: Fixes the problem
# -- FILE: doctest/CMakeLists.txt
...
project(doctest VERSION${ver})
# CHANGE-NEEDED: Use C++11 standard as default for all C++ targets.set(CMAKE_CXX_STANDARD 11)
...
ALTERNATIVE:
Set target properties to CXX_STANDARD=11 on all examples/.../CMakeLists.txt files where this information is currently missing
Steps to reproduce
Checkout / clone doctest git repository
Run cmake build (with platform / toolchain environment described above)
cmake --build .
[2/44] Building CXX object examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o
FAILED: examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DDOCTEST_CONFIG_DISABLE -I../scripts/development_only -I../doctest/parts -Werror -pedantic -pedantic-errors -fvisibility=hidden -fstrict-aliasing -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++98-compat-bind-to-temporary-copy -Wno-c++98-compat-local-type-template-args -Qunused-arguments -fcolor-diagnostics -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wno-unknown-warning-option -Wno-unneeded-internal-declaration -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-template -MD -MT examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o -MF examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o.d -o examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o -c ../examples/all_features/alternative_macros.cpp
In file included from ../examples/all_features/alternative_macros.cpp:1:
In file included from ../examples/all_features/doctest_proxy.h:6:
In file included from ../scripts/development_only/doctest/doctest.h:1:
../doctest/parts/doctest_fwd.h:400:1: error: inline namespaces are a C++11 feature [-Werror,-Wc++11-inline-namespace]
DOCTEST_STD_NAMESPACE_BEGIN
^
... (more C++11 compile errors)
Extra information
doctest version: v2.2.2 or newer (also current HEAD)
Operating System: macOS 10.14
Compiler+version: AppleClang 10.0.0
The text was updated successfully, but these errors were encountered:
Thanks for reporting! Seems that this is not enough - we forgot the case when someone is building the doctest repository itself (and not using it as a sub project)
Description
CMake build currently fails to compile on macOS (with AppleClang 10.0.0).
Doctest 2.2.2 / 2.3 or newer requires C++11 or newer, at least in the default configuration.
The default C++ compiler standard depends largely on the current toolchain / compiler version. Therefore, it would be much more robust to describe this requirement.
WORKAROUND: Fixes the problem
ALTERNATIVE:
Set target properties to
CXX_STANDARD=11
on allexamples/.../CMakeLists.txt
files where this information is currently missingSteps to reproduce
cmake --build . [2/44] Building CXX object examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o FAILED: examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -DDOCTEST_CONFIG_DISABLE -I../scripts/development_only -I../doctest/parts -Werror -pedantic -pedantic-errors -fvisibility=hidden -fstrict-aliasing -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++98-compat-bind-to-temporary-copy -Wno-c++98-compat-local-type-template-args -Qunused-arguments -fcolor-diagnostics -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -Wno-unknown-warning-option -Wno-unneeded-internal-declaration -Wno-unused-function -Wno-unused-parameter -Wno-unused-variable -Wno-unused-template -MD -MT examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o -MF examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o.d -o examples/all_features/CMakeFiles/disabled.dir/alternative_macros.cpp.o -c ../examples/all_features/alternative_macros.cpp In file included from ../examples/all_features/alternative_macros.cpp:1: In file included from ../examples/all_features/doctest_proxy.h:6: In file included from ../scripts/development_only/doctest/doctest.h:1: ../doctest/parts/doctest_fwd.h:400:1: error: inline namespaces are a C++11 feature [-Werror,-Wc++11-inline-namespace] DOCTEST_STD_NAMESPACE_BEGIN ^ ... (more C++11 compile errors)
Extra information
The text was updated successfully, but these errors were encountered: