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)