Skip to content
Snippets Groups Projects
Commit c3e637ab authored by Steffen Müthing's avatar Steffen Müthing
Browse files

[Release][CMake][Bugfix] Fail hard if we find nullptr, but not std::nullptr_t

We do not really support this combination of C++11 features, and the
only time it should occur is when the user has a recent Intel Compiler
and an outdated GCC (which the Intel Compiler uses for the C++ standard
library). In that case, we emit a helpful error message at configuration
time.
parent 467e3e5f
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,33 @@ check_cxx_source_compiles(" ...@@ -60,7 +60,33 @@ check_cxx_source_compiles("
return 0; return 0;
} }
" HAVE_NULLPTR " HAVE_NULLPTR
) )
if(HAVE_NULLPTR)
check_cxx_source_compiles("
#include <cstddef>
int main(void)
{
std::nullptr_t npt = nullptr;
return 0;
}
" HAVE_NULLPTR_T
)
if (NOT HAVE_NULLPTR_T)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
message(FATAL_ERROR "Your compiler supports the 'nullptr' keyword, but not the type std::nullptr_t.
You are using an Intel compiler, where this error is typically caused by an outdated underlying system GCC.
Check if 'gcc --version' gives you at least GCC 4.6, otherwise please install a newer GCC and point your Intel compiler at it using the '-gcc-name' or '-gxx-name' options (see 'man icc' for further details)."
)
else()
message(FATAL_ERROR "Your compiler supports the 'nullptr' keyword, but not the type std::nullptr_t.
THIS SHOULD NOT HAPPEN FOR YOUR COMPILER!
Please submit a bug at https://dune-project.org/flyspray/"
)
endif()
endif()
endif()
# __attribute__((unused)) # __attribute__((unused))
check_cxx_source_compiles(" check_cxx_source_compiles("
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment