diff --git a/CMakeLists.txt b/CMakeLists.txt index 6705ef130052..6d9c325cf03c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -378,6 +378,13 @@ if(MSVC) CMAKE_CXX_FLAGS_RELWITHDEBINFO ) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP") + if(__BUILD_FOR_R) + # MSVC does not like this commit: + # https://github.com/wch/r-source/commit/fb52ac1a610571fcb8ac92d886b9fefcffaa7d48 + # + # and raises "error C3646: 'private_data_c': unknown override specifier" + add_definitions(-DR_LEGACY_RCOMPLEX) + endif() if(USE_DEBUG) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Od") else()