Merge pull request #474 from r-a-sattarov/master

CMake: fixed compiler check algorithm (support of C++11)
This commit is contained in:
Robert Beckebans 2020-05-31 23:19:12 +02:00 committed by GitHub
commit de2cf327b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 6 deletions

View file

@ -116,18 +116,17 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
#add_definitions(-Wall)
add_definitions(-Werror=format-security)
add_definitions(-Werror=format)
# Compiler check (needs -std=c++11 flag)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_STANDARD 11)
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_STANDARD 0x)
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()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CPU_TYPE)
add_definitions(-DCPUSTRING="${CPU_TYPE}")

0
neo/cmake-linux-debug-nosimd.sh Normal file → Executable file
View file

0
neo/cmake-linux-release-nosimd.sh Normal file → Executable file
View file

View file

@ -113,7 +113,7 @@ If you have questions concerning this license or the applicable additional terms
#define CPUSTRING "e2k"
#elif defined(__aarch64__) || defined(__ARM64__) || defined(_M_ARM64)
#define CPUSTRING "aarch64"
#else
#else
#error unknown CPU
#endif
#endif