From 662007a548818b255fe7f9fe415c1a7bb0df4980 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Mon, 9 Oct 2023 07:11:47 +0900 Subject: [PATCH] Check MSVC --- cpp/cmake_modules/ThirdpartyToolchain.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake index e2a75ffddbfa2..ea75986f02e09 100644 --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake @@ -926,10 +926,13 @@ if(CMAKE_AR) list(APPEND EP_COMMON_TOOLCHAIN -DCMAKE_AR=${EP_CMAKE_AR}) endif() -if(CMAKE_RANLIB) - # Ensure using absolute path. - find_program(EP_CMAKE_RANLIB ${CMAKE_RANLIB} REQUIRED) - list(APPEND EP_COMMON_TOOLCHAIN -DCMAKE_RANLIB=${EP_CMAKE_RANLIB}) +# RANLIB isn't used for MSVC +if(NOT MSVC) + if(CMAKE_RANLIB) + # Ensure using absolute path. + find_program(EP_CMAKE_RANLIB ${CMAKE_RANLIB} REQUIRED) + list(APPEND EP_COMMON_TOOLCHAIN -DCMAKE_RANLIB=${EP_CMAKE_RANLIB}) + endif() endif() # External projects are still able to override the following declarations.