2013-08-07 14:36:45 +04:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion
|
|
|
|
OUTPUT_VARIABLE GCC_VERSION)
|
|
|
|
if(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
|
2013-12-30 02:30:48 +04:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic -Wno-long-long")
|
2013-08-07 14:36:45 +04:00
|
|
|
else(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
|
2013-12-30 02:30:48 +04:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
|
2013-08-07 14:36:45 +04:00
|
|
|
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
|
2014-08-11 17:46:45 +04:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
2013-08-07 14:36:45 +04:00
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
if(CMAKE_CXX_COMPILER MATCHES "clang")
|
2013-12-30 02:30:48 +04:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long")
|
2014-08-11 17:46:45 +04:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
|
2013-08-07 14:36:45 +04:00
|
|
|
endif(CMAKE_CXX_COMPILER MATCHES "clang")
|
|
|
|
# TODO: handle msvc compilers warnings?
|
|
|
|
|
|
|
|
if(DEFINED MIRALL_FATAL_WARNINGS)
|
|
|
|
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER MATCHES "clang")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
|
|
|
|
endif (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER MATCHES "clang")
|
|
|
|
# TODO: handle msvc compilers warnings?
|
|
|
|
endif(DEFINED MIRALL_FATAL_WARNINGS)
|