westonpace commented on PR #36206:
URL: https://github.com/apache/arrow/pull/36206#issuecomment-1601547478
Actually, it looks like we are already using object libraries:
```
if(WIN32
OR (CMAKE_GENERATOR STREQUAL Xcode)
OR CMAKE_VERSION VERSION_LESS 3.12
OR NOT ARROW_POSITION_INDEPENDENT_CODE)
# We need to compile C++ separately for each library kind (shared and
static)
# because of dllexport declarations on Windows.
# The Xcode generator doesn't reliably work with Xcode as target names
are not
# guessed correctly.
# We can't use target for object library with CMake 3.11 or earlier.
# See also: Object Libraries:
#
https://cmake.org/cmake/help/latest/command/add_library.html#object-libraries
set(USE_OBJLIB OFF)
else()
set(USE_OBJLIB ON)
endif()
if(USE_OBJLIB)
# Generate a single "objlib" from all C++ modules and link
# that "objlib" into each library kind, to avoid compiling twice
add_library(${LIB_NAME}_objlib OBJECT ${ARG_SOURCES})
```
I don't know if these requirements (e.g. XCode, WIN32) apply for these
testing libraries or not but it seems we can't always use object libraries in
all situations.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]