Make our build checks relate to the new compiler world order

(thanks lethosor)

Signed-off-by: Michael Casadevall <mcasadevall@ubuntu.com>
develop
Michael Casadevall 2016-06-28 07:13:46 -05:00
parent 62e8740e3a
commit c3188b1d6c
1 changed files with 43 additions and 49 deletions

@ -13,12 +13,14 @@ IF(CMAKE_COMPILER_IS_GNUCC)
#ENDIF()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
SET(HAVE_HASH_MAP 0)
SET(HASH_MAP_CLASS unordered_map)
ENDIF()
#Check for all of the possible combinations of unordered_map and hash_map
SET(HAVE_HASH_MAP 0)
SET(HASH_MAP_CLASS unordered_map)
FOREACH(header tr1/unordered_map unordered_map)
#Check for all of the possible combinations of unordered_map and hash_map
FOREACH(header tr1/unordered_map unordered_map)
FOREACH(namespace std::tr1 std )
IF(HAVE_HASH_MAP EQUAL 0 AND NOT STL_HASH_OLD_GCC)
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/testHashMap.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/testHashMap.cpp")
@ -39,8 +41,8 @@ IF(CMAKE_COMPILER_IS_GNUCC)
ENDIF()
ENDIF()
ENDFOREACH(namespace)
ENDFOREACH(header)
IF (HAVE_HASH_MAP EQUAL 0)
ENDFOREACH(header)
IF (HAVE_HASH_MAP EQUAL 0)
SET(HASH_MAP_CLASS hash_map)
FOREACH(header ext/hash_map hash_map)
FOREACH(namespace __gnu_cxx "" std stdext)
@ -59,22 +61,14 @@ IF(CMAKE_COMPILER_IS_GNUCC)
ENDIF()
ENDFOREACH()
ENDFOREACH()
ENDIF()
ENDIF()
IF (HAVE_HASH_MAP EQUAL 0)
IF (HAVE_HASH_MAP EQUAL 0)
MESSAGE(SEND_ERROR "Could not find a working hash map implementation. Please install GCC >= 4.4, and all necessary 32-bit C++ development libraries.")
ENDIF()
ENDIF()
IF(UNIX)
FIND_PACKAGE(Threads)
ELSE()
SET(HASH_MAP_H <hash_map>)
SET(HASH_NAMESPACE std)
SET(HASH_SET_H <hash_set>)
SET(HAVE_HASH_MAP 1)
SET(HAVE_HASH_SET 1)
SET(HASH_MAP_CLASS hash_map)
SET(HASH_SET_CLASS hash_set)
ENDIF()
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h")