diff options
author | tycho <work.tycho@gmail.com> | 2015-05-24 16:22:55 +0200 |
---|---|---|
committer | tycho <work.tycho@gmail.com> | 2015-05-24 16:22:55 +0200 |
commit | 51b4584b425bbc9c96b4967b9391479768d3cb28 (patch) | |
tree | 0ee0c3a36aded3ab32a45ed3267ecc1e89a2a060 /SetFlags.cmake | |
parent | Fix comments (diff) | |
download | cuberite-51b4584b425bbc9c96b4967b9391479768d3cb28.tar cuberite-51b4584b425bbc9c96b4967b9391479768d3cb28.tar.gz cuberite-51b4584b425bbc9c96b4967b9391479768d3cb28.tar.bz2 cuberite-51b4584b425bbc9c96b4967b9391479768d3cb28.tar.lz cuberite-51b4584b425bbc9c96b4967b9391479768d3cb28.tar.xz cuberite-51b4584b425bbc9c96b4967b9391479768d3cb28.tar.zst cuberite-51b4584b425bbc9c96b4967b9391479768d3cb28.zip |
Diffstat (limited to '')
-rw-r--r-- | SetFlags.cmake | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/SetFlags.cmake b/SetFlags.cmake index c20a45133..d824d054a 100644 --- a/SetFlags.cmake +++ b/SetFlags.cmake @@ -27,6 +27,16 @@ macro(add_flags_cxx FLAGS) endmacro() +#this is a hack because we can't use cmake 2.8.10 because of travis +macro(get_clang_version) + execute_process( + COMMAND "${CMAKE_CXX_COMPILER}" "--version" + OUTPUT_VARIABLE CLANG_VERSION_OUTPUT) + string(REGEX MATCH "version ([0-9]\\.[0-9])" x ${CLANG_VERSION_OUTPUT}) + set(CLANG_VERSION ${CMAKE_MATCH_1}) +endmacro() + + macro(set_flags) # Add coverage processing, if requested: if (NOT MSVC) @@ -113,6 +123,10 @@ macro(set_flags) add_flags_cxx("-march=native") endif() + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + get_clang_version() + endif() + # Use static CRT in MSVC builds: if (MSVC) @@ -215,15 +229,6 @@ macro(enable_profile) endif() endmacro() -#this is a hack because we can't use cmake 2.8.10 because of travis -macro(get_clang_version) - execute_process( - COMMAND "${CMAKE_CXX_COMPILER}" "--version" - OUTPUT_VARIABLE CLANG_VERSION_OUTPUT) - string(REGEX MATCH "version ([0-9]\\.[0-9])" x ${CLANG_VERSION_OUTPUT}) - set(CLANG_VERSION ${CMAKE_MATCH_1}) -endmacro() - macro(set_exe_flags) # Remove disabling the maximum warning level: # clang does not like a command line that reads -Wall -Wextra -w -Wall -Wextra and does not output any warnings @@ -242,7 +247,6 @@ macro(set_exe_flags) add_flags_cxx("-ffast-math") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - get_clang_version() if ("${CLANG_VERSION}" VERSION_LESS 3.0) message(FATAL_ERROR "MCServer requires clang version 3.0 or higher, version is ${CLANG_VERSION}") endif() |