Skip to content
Snippets Groups Projects
Commit f7eed34c authored by Yifan Zhao's avatar Yifan Zhao
Browse files

Added compiler version check

parent 61fba481
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,18 @@ find_package(CUDA 6.5 REQUIRED)
set(CUDA_SEPARABLE_COMPILATION ON CACHE BOOL "")
set(CUDA_PROPAGATE_HOST_FLAGS OFF)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# gcc > 8 are not supported
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8)
message(FATAL_ERROR "GCC versions later than 8 are not supported")
endif()
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# clang < 3.2 || clang >= 9 unsupported
set(clang_v ${CMAKE_CXX_COMPILER_VERSION})
if (clang_v VERSION_GREATER_EQUAL 9 OR clang_v VERSION_LESS_EQUAL 3.2)
message(FATAL_ERROR "Clang<3.2 or clang>=9 are not supported")
endif()
endif()
# Addresses a bug where code is not compiled as C++11 in non-CUDA code and older g++ versions
# Edit: using c++14 now
set(CMAKE_CXX_STANDARD 14)
......
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