2018-03-29 09:59:04 +03:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \
|
|
|
|
-Wall \
|
|
|
|
-Wextra \
|
|
|
|
-Werror \
|
|
|
|
-pipe \
|
2018-05-08 18:43:56 +03:00
|
|
|
-Wno-unused-function \
|
2018-03-29 09:59:04 +03:00
|
|
|
-pedantic \
|
|
|
|
-Wunreachable-code")
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
|
|
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
|
|
|
|
|
|
|
if (GCC_VERSION VERSION_GREATER 4.9)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always" )
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always" )
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT APPLE AND NOT MSVC)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
|
|
|
|
endif()
|