Enable in-package substitute of tr1/tuple

In clang 6.0 the tr1/tuple header is not present, and this cause a
compilation error inside of the gtest framework. However, if we set a
define, it will use its own substitute of tr1/tuple, which is sufficient
for the unit tests.
This commit is contained in:
Roland Kaufmann committed 2015-01-01 19:46:25 +01:00
1 parent b019ad260d
commit eac27f149a
3 files changed
+10

No files matched your search

@@ -75,6 +75,10 @@ set( LINK_LIBRARIES
${QT_LIBRARIES}
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "-DGTEST_USE_OWN_TR1_TUPLE=1")
endif()
add_executable( ${ProjectName}
${CODE_HEADER_FILES}
@@ -61,6 +61,10 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set( EXTERNAL_LINK_LIBRARIES
pthread
)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set( CMAKE_CXX_FLAGS
"-DGTEST_USE_OWN_TR1_TUPLE=1"
)
ENDIF()
target_link_libraries( ${ProjectName} ${LINK_LIBRARIES} ${EXTERNAL_LINK_LIBRARIES})
@@ -87,6 +87,8 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNO_DEBUG")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ")
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(CMAKE_CXX_FLAGS "-DGTEST_USE_OWN_TR1_TUPLE=1")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")