Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
elseif(MSVC)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I let this be the more restrictive condition as I wasn't sure if any "MSVC like" compilers would support the version file, I'm not aware of any that do, so I think this suggestion is probably fine, but I'm not aware of the scope of Arrow's deployment, and just wanted to point out there are side effects from changing this check beyond terseness, just to be safe.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All MSVC like compilers behave like #50450 (comment) , right? (All symbols are hidden by default.)

If so, can we use elseif(MSVC) here?

# 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
Expand Down
Loading