Added compiler check for support of C ++ 11 standard

pull/314/head
r-a-sattarov 4 years ago
parent 8e64503338
commit 0297a00ebc

@ -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…
Cancel
Save