From db2e976ed71e9ca05cd23d1e199640e97fc42ff3 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Fri, 14 May 2021 21:31:12 -0500 Subject: [PATCH] [R-package] suppress Wcast-function-type warning in CMake-based gcc and MinGW builds (fixes #4273) (#4274) * [R-package] suppress Wcast-function-type warning in CMake-based gcc and MinGW builds (fixes #4273) * suppress warning from CMake side --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41fb21f5e54c..48c1ac040f26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -283,6 +283,9 @@ if(UNIX OR MINGW OR CYGWIN) if(NOT USE_OPENMP) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas -Wno-unused-private-field") endif() + if(__BUILD_FOR_R AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-cast-function-type") + endif() endif() if(WIN32 AND MINGW)