kou commented on code in PR #40578:
URL: https://github.com/apache/arrow/pull/40578#discussion_r1527117999
##########
cpp/src/arrow/CMakeLists.txt:
##########
@@ -968,6 +968,8 @@ if(NOT ARROW_BUILD_SHARED AND ARROW_BUILD_STATIC)
string(APPEND ARROW_TESTING_PC_CFLAGS "${ARROW_TESTING_PC_CFLAGS_PRIVATE}")
set(ARROW_TESTING_PC_CFLAGS_PRIVATE "")
+
+ string(APPEND ARROW_PC_LIBS_PRIVATE " -l${CMAKE_DL_LIBS}")
Review Comment:
As a packager view, reusability of object files isn't so important.
Composing shared/static libraries to one package family (`libarrow15` and
`libarrow-dev` for .deb) is important. Building twice for shared and static
libraries isn't easy to compose...
For example:
* Both of `cmake --install` for shared library and `cmake --install` for
static library install not only library files but also header files, data files
and so on. Most of header files will be same but some files may be different.
In our case, `arrow/util/config.h` may be different if we have some
`#cmakedefine`s that depend on library type. If there are different files,
package for shared library and package for static library will be conflicted.
* CMake packages for shared library and static library are different. We
need to use different CMake package names (e.g. `ArrowShared` for shared
library and `ArrowStatic` for static library) to avoid conflicting them.
* ...
GoogleTest is a product that doesn't support building both of shared and
static libraries at once.
MSYS2 package of it building GoogleTest twice:
*
https://github.com/msys2/MINGW-packages/blob/ad99b751d11d027345f6da4c91b4c33d5ad1ac7d/mingw-w64-gtest/PKGBUILD#L36-L60
*
https://github.com/msys2/MINGW-packages/blob/ad99b751d11d027345f6da4c91b4c33d5ad1ac7d/mingw-w64-gtest/PKGBUILD#L64-L68
The package provides only CMake package for shared library:
https://github.com/msys2/MINGW-packages/blob/ad99b751d11d027345f6da4c91b4c33d5ad1ac7d/mingw-w64-gtest/PKGBUILD#L70-L71
It means that users can't use static library version via its CMake package.
--
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]