From 3b3d0dd9595a25041b3f9226d26006b5fe098704 Mon Sep 17 00:00:00 2001 From: John Parent Date: Thu, 9 Jul 2026 11:27:35 -0400 Subject: [PATCH 1/2] GH-50449: Invalid version script argument supplied to MSVC linker Signed-off-by: John Parent --- cpp/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 143f915b3dea..ecc92b68d0e5 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -362,6 +362,10 @@ if(CMAKE_VERSION VERSION_LESS 3.18) else() set(CXX_LINKER_SUPPORTS_VERSION_SCRIPT TRUE) endif() +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # msvc does not support version scripts, but check_linker_flag won't return false + # due to how msvc's linker reports unrecognized arguments + set(CXX_LINKER_SUPPORTS_VERSION_SCRIPT FALSE) else() include(CheckLinkerFlag) check_linker_flag(CXX From 427117614775c245f60f4bc457181a36d9d79921 Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Thu, 9 Jul 2026 17:18:46 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Sutou Kouhei --- cpp/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index ecc92b68d0e5..b7d89c1944a0 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -363,8 +363,8 @@ if(CMAKE_VERSION VERSION_LESS 3.18) set(CXX_LINKER_SUPPORTS_VERSION_SCRIPT TRUE) endif() elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - # msvc does not support version scripts, but check_linker_flag won't return false - # due to how msvc's linker reports unrecognized arguments + # MSVC does not support version scripts, but check_linker_flag won't return false + # due to how MSVC's linker reports unrecognized arguments set(CXX_LINKER_SUPPORTS_VERSION_SCRIPT FALSE) else() include(CheckLinkerFlag)