Commit 68237068 authored by Marian Triebe's avatar Marian Triebe

Add `--no-compiler-check` to configure script.

With this option you can disable the compiler version check.
parent 2de0c407
...@@ -72,28 +72,30 @@ endif() ...@@ -72,28 +72,30 @@ endif()
################################################################################ ################################################################################
# check for g++ >= 4.7 or clang++ > = 3.2 # check for g++ >= 4.7 or clang++ > = 3.2
try_run(ProgramResult if(NOT NO_COMPILER_CHECK)
CompilationSucceeded try_run(ProgramResult
${CMAKE_BINARY_DIR} CompilationSucceeded
${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_compiler_version.cpp ${CMAKE_BINARY_DIR}
RUN_OUTPUT_VARIABLE CompilerVersion) ${CMAKE_CURRENT_SOURCE_DIR}/cmake/get_compiler_version.cpp
if(NOT CompilationSucceeded OR NOT ProgramResult EQUAL 0) RUN_OUTPUT_VARIABLE CompilerVersion)
message(FATAL_ERROR "Cannot determine compiler version") if(NOT CompilationSucceeded OR NOT ProgramResult EQUAL 0)
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") message(FATAL_ERROR "Cannot determine compiler version")
if(CompilerVersion VERSION_GREATER 4.6) elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
message(STATUS "Found g++ version ${CompilerVersion}") if(CompilerVersion VERSION_GREATER 4.6)
else() message(STATUS "Found g++ version ${CompilerVersion}")
message(FATAL_ERROR "g++ >= 4.7 required (found: ${CompilerVersion})") else()
endif() message(FATAL_ERROR "g++ >= 4.7 required (found: ${CompilerVersion})")
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") endif()
if(CompilerVersion VERSION_GREATER 3.1) elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
message(STATUS "Found clang++ version ${CompilerVersion}") if(CompilerVersion VERSION_GREATER 3.1)
message(STATUS "Found clang++ version ${CompilerVersion}")
else()
message(FATAL_ERROR "clang++ >= 3.2 required (found: ${CompilerVersion})")
endif()
else() else()
message(FATAL_ERROR "clang++ >= 3.2 required (found: ${CompilerVersion})") message(FATAL_ERROR "Your C++ compiler does not support C++11 "
"or is not supported")
endif() endif()
else()
message(FATAL_ERROR "Your C++ compiler does not support C++11 "
"or is not supported")
endif() endif()
# check if the user provided CXXFLAGS, set defaults otherwise # check if the user provided CXXFLAGS, set defaults otherwise
if(CMAKE_CXX_FLAGS) if(CMAKE_CXX_FLAGS)
......
...@@ -33,6 +33,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]... ...@@ -33,6 +33,7 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
--build-static build as static and shared library --build-static build as static and shared library
--build-static-only build as static library only --build-static-only build as static library only
--more-clang-warnings enables most of Clang's warning flags --more-clang-warnings enables most of Clang's warning flags
--no-compiler-check disable compiler version check
Installation Directories: Installation Directories:
--prefix=PREFIX installation directory [/usr/local] --prefix=PREFIX installation directory [/usr/local]
...@@ -212,6 +213,9 @@ while [ $# -ne 0 ]; do ...@@ -212,6 +213,9 @@ while [ $# -ne 0 ]; do
--more-clang-warnings) --more-clang-warnings)
append_cache_entry MORE_CLANG_WARNINGS BOOL yes append_cache_entry MORE_CLANG_WARNINGS BOOL yes
;; ;;
--no-compiler-check)
append_cache_entry NO_COMPILER_CHECK BOOL yes
;;
--with-log-level=*) --with-log-level=*)
level=`echo "$optarg" | tr '[:lower:]' '[:upper:]'` level=`echo "$optarg" | tr '[:lower:]' '[:upper:]'`
case $level in case $level in
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment