From 25621eb5a309bce99cb00fdb04807e76820fd8c2 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 11 Oct 2023 08:46:32 +0900 Subject: [PATCH] Always use 19.20 (Visual Studio 16 2019) for now --- cpp/src/gandiva/precompiled/CMakeLists.txt | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/cpp/src/gandiva/precompiled/CMakeLists.txt b/cpp/src/gandiva/precompiled/CMakeLists.txt index 0cb7e31f00017..3e41640861123 100644 --- a/cpp/src/gandiva/precompiled/CMakeLists.txt +++ b/cpp/src/gandiva/precompiled/CMakeLists.txt @@ -30,25 +30,17 @@ set(PRECOMPILED_SRCS timestamp_arithmetic.cc ../../arrow/util/basic_decimal.cc) +set(PLATFORM_CLANG_OPTIONS -std=c++17) if(MSVC) - # clang pretends to be a particular version of MSVC. The standard - # library uses C++14 features, so we have to use that -std version - # to get the IR compilation to work. + # "19.20" means that it's compatible with Visual Studio 16 2019. + # We can update this to "19.30" when we dropped support for Visual + # Studio 16 2019. + # # See https://cmake.org/cmake/help/latest/variable/MSVC_VERSION.html # for MSVC_VERSION and Visual Studio version. - if(MSVC_VERSION LESS 1920) - set(FMS_COMPATIBILITY 19.10) - elseif(MSVC_VERSION LESS 1930) - set(FMS_COMPATIBILITY 19.20) - elseif(MSVC_VERSION LESS 1940) - set(FMS_COMPATIBILITY 19.30) - else() - message(FATAL_ERROR "Unsupported MSVC_VERSION=${MSVC_VERSION}") - endif() - set(PLATFORM_CLANG_OPTIONS -std=c++17 -fms-compatibility - -fms-compatibility-version=${FMS_COMPATIBILITY}) -else() - set(PLATFORM_CLANG_OPTIONS -std=c++17) + set(FMS_COMPATIBILITY 19.20) + list(APPEND PLATFORM_CLANG_OPTIONS -fms-compatibility + -fms-compatibility-version=${FMS_COMPATIBILITY}) endif() # Create bitcode for each of the source files.