Skip to content

Commit

Permalink
Revert "Introduce HICTK_PREFER_STATIC_LINKING build knob"
Browse files Browse the repository at this point in the history
This reverts commit c011251.
  • Loading branch information
robomics committed Feb 11, 2024
1 parent c011251 commit 71fdb94
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 54 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ option(HICTK_BUILD_EXAMPLES "Build examples" OFF)
option(HICTK_BUILD_BENCHMARKS "Build benchmarks" OFF)
option(HICTK_WITH_EIGEN "Build with Eigen3 support" ON)
option(HICTK_BUILD_TOOLS "Build cli tools" ON)
option(HICTK_PREFER_STATIC_LINKING "Prefer linking to static libraries" OFF)

if(HICTK_WITH_EIGEN)
target_compile_definitions(hictk_project_options INTERFACE HICTK_WITH_EIGEN)
Expand Down
16 changes: 2 additions & 14 deletions src/libhictk/balancing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,7 @@ target_link_system_libraries(
INTERFACE
bshoshany-thread-pool::bshoshany-thread-pool
nonstd::span-lite
phmap)

if(BUILD_SHARED_LIBS AND HICTK_PREFER_STATIC_LINKING)
if(TARGET zstd::libzstd_static)
target_link_system_libraries(balancing INTERFACE zstd::libzstd_static)
else()
target_link_system_libraries(balancing INTERFACE zstd::libzstd_shared)
endif()
else()
target_link_system_libraries(
balancing
INTERFACE
"zstd::libzstd_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>")
endif()
phmap
"zstd::libzstd_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>")

target_compile_definitions(balancing INTERFACE span_FEATURE_MAKE_SPAN=1)
23 changes: 3 additions & 20 deletions src/libhictk/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,6 @@ target_sources(
target_include_directories(common INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")

target_link_system_libraries(common INTERFACE fmt::fmt-header-only)

if(BUILD_SHARED_LIBS AND HICTK_PREFER_STATIC_LINKING)
if(TARGET libdeflate::libdeflate_static)
target_link_system_libraries(common INTERFACE libdeflate::libdeflate_static)
else()
target_link_system_libraries(common INTERFACE libdeflate::libdeflate_shared)
endif()
if(TARGET zstd::libzstd_static)
target_link_system_libraries(common INTERFACE zstd::libzstd_static)
else()
target_link_system_libraries(common INTERFACE zstd::libzstd_shared)
endif()
else()
target_link_system_libraries(
common
INTERFACE
"libdeflate::libdeflate_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>"
"zstd::libzstd_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>")
endif()
target_link_libraries(
common INTERFACE fmt::fmt-header-only "libdeflate::libdeflate_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>"
"zstd::libzstd_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>")
19 changes: 0 additions & 19 deletions src/libhictk/hic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,3 @@ target_link_system_libraries(
phmap
readerwriterqueue::readerwriterqueue
"zstd::libzstd_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>")

if(BUILD_SHARED_LIBS AND HICTK_PREFER_STATIC_LINKING)
if(TARGET libdeflate::libdeflate_static)
target_link_system_libraries(hic INTERFACE libdeflate::libdeflate_static)
else()
target_link_system_libraries(hic INTERFACE libdeflate::libdeflate_shared)
endif()
if(TARGET zstd::libzstd_static)
target_link_system_libraries(hic INTERFACE zstd::libzstd_static)
else()
target_link_system_libraries(hic INTERFACE zstd::libzstd_shared)
endif()
else()
target_link_system_libraries(
hic
INTERFACE
"libdeflate::libdeflate_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>"
"zstd::libzstd_$<IF:$<BOOL:${BUILD_SHARED_LIBS}>,shared,static>")
endif()

0 comments on commit 71fdb94

Please sign in to comment.