Added compiler check for support of C ++ 11 standard
This commit is contained in:
parent
8e64503338
commit
0297a00ebc
@ -5,11 +5,16 @@ ENABLE_TESTING()
|
|||||||
SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake")
|
SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake")
|
||||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}")
|
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}")
|
||||||
|
|
||||||
# GCC check (needs -std:c++11 flag)
|
# Compiler check (needs -std:c++11 flag)
|
||||||
#if(CMAKE_COMPILER_IS_GNUCC)
|
include(CheckCXXCompilerFlag)
|
||||||
# ADD_DEFINITIONS("-std=c++11")
|
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||||
#ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
if(COMPILER_SUPPORTS_CXX11)
|
||||||
set (CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
|
||||||
|
endif()
|
||||||
|
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
# gnuwin32 paths:
|
# gnuwin32 paths:
|
||||||
|
Loading…
Reference in New Issue
Block a user