diff --git a/CMakeLists.txt b/CMakeLists.txt index 185a3e8097..d576c4ea96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -212,6 +212,10 @@ endif() if(ENABLE_LTO) check_and_add_flag(LTO -flto) + if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) + set(CMAKE_AR gcc-ar) + set(CMAKE_RANLIB gcc-ranlib) + endif() endif() if(APPLE)