Added support for gcc and c++11 features.
This commit is contained in:
parent
7e2a9d1adb
commit
6bc3224fe7
@ -5,6 +5,11 @@ 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)
|
||||
|
||||
IF(WIN32)
|
||||
# gnuwin32 paths:
|
||||
SET(GNUWIN32_PATH "${NV_SOURCE_DIR}/extern/gnuwin32")
|
||||
@ -68,3 +73,4 @@ IF(WIN32)
|
||||
ENDIF(WIN32)
|
||||
|
||||
INCLUDE(CPack)
|
||||
|
||||
|
@ -131,7 +131,12 @@
|
||||
#define NV_CC_CPP11 (__cplusplus > 199711L)
|
||||
#else
|
||||
// @@ IC: This works in CLANG, about GCC?
|
||||
// @@ ES: Doesn't work in gcc. These 3 features are available in GCC >= 4.4.
|
||||
#ifdef __clang__
|
||||
#define NV_CC_CPP11 (__has_feature(cxx_deleted_functions) && __has_feature(cxx_rvalue_references) && __has_feature(cxx_static_assert))
|
||||
#elif defined __GNUC__
|
||||
#define NV_CC_CPP11 ( __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Endiannes:
|
||||
|
Loading…
Reference in New Issue
Block a user