2016-07-26 17:53:11 +03:00
|
|
|
# (c) 2014 Copyright ownCloud GmbH
|
2014-09-18 14:26:55 +04:00
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING* file.
|
|
|
|
|
2016-09-14 16:31:05 +03:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
2019-09-09 20:35:30 +03:00
|
|
|
|
|
|
|
# Use this only for Clang
|
2021-06-07 14:43:15 +03:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
2019-09-09 20:35:30 +03:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-long-long -Wno-gnu-zero-variadic-macro-arguments")
|
|
|
|
endif()
|
2015-02-17 19:27:32 +03:00
|
|
|
|
2018-01-04 22:46:14 +03:00
|
|
|
# Fix sqlite compilation on macOS
|
2018-01-04 21:54:56 +03:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-incompatible-pointer-types-discards-qualifiers")
|
|
|
|
|
2016-09-14 16:31:05 +03:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
|
2018-04-23 13:51:58 +03:00
|
|
|
# Fix sqlite compilation on MinGW
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-discarded-qualifiers")
|
|
|
|
|
2016-09-14 16:31:05 +03:00
|
|
|
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)
|
2022-08-02 17:26:38 +03:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
|
2016-09-14 16:31:05 +03:00
|
|
|
else(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
|
|
|
|
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
|
|
|
|
else()
|
2015-02-17 19:27:32 +03:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
|
2016-09-14 16:31:05 +03:00
|
|
|
endif()
|
2013-08-07 14:36:45 +04:00
|
|
|
|
2016-09-14 16:31:05 +03:00
|
|
|
endif()
|