build: remove clang 6-9 references from CMake scripts

As stated in the release notes, the minimum supported version of clang is 10.0.
This commit is contained in:
André Apitzsch
2023-10-23 10:22:45 +02:00
parent f33ec133c5
commit ecd3874a24
3 changed files with 2 additions and 50 deletions

View File

@@ -12,7 +12,7 @@ file(STRINGS VERSION NS3_VER)
# minimum compiler versions
set(AppleClang_MinVersion 11.0.0)
set(Clang_MinVersion 6.0.0)
set(Clang_MinVersion 10.0.0)
set(GNU_MinVersion 8.0.0)
# common options

View File

@@ -1,16 +0,0 @@
#ifndef OSTREAM_OPERATOR_NULLPTR_H
#define OSTREAM_OPERATOR_NULLPTR_H
#include <cstddef>
#include <iostream>
namespace std
{
inline std::ostream&
operator<<(std::ostream& os, std::nullptr_t)
{
return os << "nullptr"; // whatever you want nullptr to show up as in the console
}
} // namespace std
#endif // OSTREAM_OPERATOR_NULLPTR_H

View File

@@ -17,39 +17,7 @@
include(CheckCXXSourceCompiles)
# Clang 6, 7 and 8 shipped with incomplete C++17 features and do not handle
# ostream& operator<<(ostream& os, nullptr_t ptr)
# https://gitlab.com/nsnam/ns-3-dev/-/issues/730
check_cxx_source_compiles(
"
#include <iostream>
#include <cstddef>
inline std::ostream& operator << (std::ostream& os, std::nullptr_t ptr)
{
return os << \"nullptr\"; //whatever you want nullptr to show up as in the console
}
int main()
{
std::ostream os(NULL);
os << std::nullptr_t();
return 0;
}
"
MISSING_OSTREAM_NULLPTR_OPERATOR
)
if(${MISSING_OSTREAM_NULLPTR_OPERATOR})
message(
${HIGHLIGHTED_STATUS}
"Using compiler workaround: compiling in \"ostream& operator<<(ostream&, nullptr_t)\""
)
add_definitions(
-include
${CMAKE_CURRENT_SOURCE_DIR}/build-support/compiler-workarounds/ostream-operator-nullptr.h
)
endif()
# Some compilers (e.g. GCC < 9.1 and Clang < 9) do not link
# Some compilers (e.g. GCC < 9.1) do not link
# std::filesystem/std::experimental::filesystem by default. If the sample
# program can be linked, it means it is indeed linked by default. Otherwise, we
# link it manually. https://en.cppreference.com/w/cpp/filesystem