#
# Check whether the std::vector::iterator is just a plain pointer
#
-# TODO: Get rid of this negation!
-CHECK_CXX_SOURCE_COMPILES(
+CHECK_CXX_COMPILER_BUG( # Yes. It is not a bug. But the logic is the same.
"
#include <vector>
template <typename T> void f(T) {}
template void f(std::vector<int>::iterator);
int main(){return 0;}
"
- DEAL_II_VECTOR_ITERATOR_IS_NOT_POINTER)
-
-IF(NOT DEAL_II_VECTOR_ITERATOR_IS_NOT_POINTER)
- SET(DEAL_II_VECTOR_ITERATOR_IS_POINTER TRUE)
-ENDIF()
+ DEAL_II_VECTOR_ITERATOR_IS_POINTER)
--- /dev/null
+INCLUDE(CheckCXXSourceCompiles)
+
+MACRO(CHECK_CXX_COMPILER_BUG source var)
+
+ #
+ # Check for a compiler bug, i.e. if source does not compile, define var
+ # This just inverts the logic of CHECK_CXX_SOURCE_COMPILES.
+ #
+
+ CHECK_CXX_SOURCE_COMPILES(
+ "${source}"
+ ${var}_OK)
+
+ IF(${var}_OK)
+ MESSAGE(STATUS "Test successful, do not define ${var}")
+ ELSE()
+ MESSAGE(STATUS "Test unsuccessful, definig ${var}")
+ SET(${var} 1)
+ ENDIF()
+
+ENDMACRO()
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams