From 3dfa201688b96f3b5dab3057bce89975ba7f2ad5 Mon Sep 17 00:00:00 2001 From: Daeho Ro <40587651+daeho-ro@users.noreply.github.com> Date: Wed, 4 Nov 2026 21:20:46 +0900 Subject: [PATCH 1/2] Find Threads in the installed CMake package config --- src/openjph-config.cmake.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openjph-config.cmake.in b/src/openjph-config.cmake.in index 89dcc67e..b27fc2de 100644 --- a/src/openjph-config.cmake.in +++ b/src/openjph-config.cmake.in @@ -1,5 +1,8 @@ @PACKAGE_INIT@ +include(CMakeFindDependencyMacro) +find_dependency(Threads) + include("${CMAKE_CURRENT_LIST_DIR}/openjph-targets.cmake") check_required_components(openjph) From 40761b07db4e35bc374259bfb7a70e3108f065ae Mon Sep 17 00:00:00 2001 From: Aous Naman Date: Sat, 14 Nov 2026 08:35:53 +0000 Subject: [PATCH 2/2] A simpler, less intrusive solution --- src/core/CMakeLists.txt | 4 ++-- src/openjph-config.cmake.in | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c624c108..36184e4f 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -164,9 +164,9 @@ add_library(openjph ${SOURCES}) ## emitted by libstdc++ are weak, so --as-needed drops the library; force it. find_package(Threads REQUIRED) if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") - target_link_libraries(openjph PUBLIC "-Wl,--no-as-needed" Threads::Threads) + target_link_libraries(openjph PRIVATE "-Wl,--no-as-needed" Threads::Threads) else() - target_link_libraries(openjph PUBLIC Threads::Threads) + target_link_libraries(openjph PRIVATE Threads::Threads) endif() ## The option BUILD_SHARED_LIBS diff --git a/src/openjph-config.cmake.in b/src/openjph-config.cmake.in index b27fc2de..89dcc67e 100644 --- a/src/openjph-config.cmake.in +++ b/src/openjph-config.cmake.in @@ -1,8 +1,5 @@ @PACKAGE_INIT@ -include(CMakeFindDependencyMacro) -find_dependency(Threads) - include("${CMAKE_CURRENT_LIST_DIR}/openjph-targets.cmake") check_required_components(openjph)