Skip to content

Commit

Permalink
Always use 19.20 (Visual Studio 16 2019) for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 11, 2023
1 parent 7598af3 commit 25621eb
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions cpp/src/gandiva/precompiled/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 25621eb

Please sign in to comment.