Skip to content

Commit e418579

Browse files
committed
Keep absl API available in the shared library
1 parent b8544bb commit e418579

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

clickhouse/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ SET_TARGET_PROPERTIES (clickhouse-cpp-lib
109109
LINKER_LANGUAGE CXX
110110
VERSION ${CLICKHOUSE_CPP_VERSION}
111111
)
112+
113+
IF (BUILD_SHARED_LIBS AND NOT WITH_SYSTEM_ABSEIL)
114+
GET_TARGET_PROPERTY(absl_orignal_lib absl::int128 ALIASED_TARGET)
115+
SET_PROPERTY (TARGET ${absl_orignal_lib} PROPERTY POSITION_INDEPENDENT_CODE ON)
116+
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib
117+
-Wl,--whole-archive
118+
absl::int128
119+
-Wl,--no-whole-archive
120+
)
121+
ENDIF()
122+
112123
TARGET_LINK_LIBRARIES (clickhouse-cpp-lib
113124
absl::int128
114125
cityhash::cityhash

0 commit comments

Comments
 (0)