Merge pull request #314 from r-a-sattarov/master
Added compiler check for support of C++11 standard
This commit is contained in:
commit
3e034d2de1
@ -5,11 +5,16 @@ ENABLE_TESTING()
|
||||
SET(NV_CMAKE_DIR "${NV_SOURCE_DIR}/cmake")
|
||||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NV_CMAKE_DIR}")
|
||||
|
||||
# GCC check (needs -std:c++11 flag)
|
||||
#if(CMAKE_COMPILER_IS_GNUCC)
|
||||
# ADD_DEFINITIONS("-std=c++11")
|
||||
#ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||||
set (CMAKE_CXX_STANDARD 11)
|
||||
# Compiler check (needs -std:c++11 flag)
|
||||
include(CheckCXXCompilerFlag)
|
||||
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
|
||||
if(COMPILER_SUPPORTS_CXX11)
|
||||
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)
|
||||
# gnuwin32 paths:
|
||||
|
Loading…
Reference in New Issue
Block a user