Loading pkgs/development/libraries/tbb/default.nix +10 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,16 @@ stdenv.mkDerivation rec { }) # Fix Threads::Threads target for static from https://github.com/oneapi-src/oneTBB/pull/1248 # This is a conflict-resolved cherry-pick of the above PR to due to formatting differences. ./patches/fix-cmake-threads-threads-target-for-static.patch (fetchpatch { name = "fix-cmake-threads-threads-target-for-static.patch"; url = "https://patch-diff.githubusercontent.com/raw/uxlfoundation/oneTBB/pull/1248.patch"; hash = "sha256-3WKzxU93vxuy7NgW+ap+ocZz5Q5utZ/pK7+FQExzLLA="; }) ]; patchFlags = [ "-p1" "--ignore-whitespace" ]; # Fix build with modern gcc Loading pkgs/development/libraries/tbb/patches/fix-cmake-threads-threads-target-for-static.patchdeleted 100644 → 0 +0 −34 Original line number Diff line number Diff line From b42f074a724a41d2369a94283a2e94190d0cbb44 Mon Sep 17 00:00:00 2001 From: Liam Keegan <liam@keegan.ch> Date: Fri, 10 Nov 2023 09:08:42 +0100 Subject: [PATCH] Fix CMake "Threads::Threads target not found" issue for static builds (#1248) - add `Threads` dependency to installed CMake config for static builds only - based on #912 by @p12tic including reviewer comments from @ilya-lavrenov and @isaevil - resolves #1145 Signed-off-by: Liam Keegan <liam@keegan.ch> (cherry picked from commit 12ceae12138af08845b3e8c369b24527346fe99e) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16ee29ed..0bc39a52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,6 +265,10 @@ else() COMPONENT devel) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake)\n") + if (NOT BUILD_SHARED_LIBS) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + "include(CMakeFindDependencyMacro)\nfind_dependency(Threads)\n") + endif() write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" COMPATIBILITY AnyNewerVersion) -- 2.49.0 Loading
pkgs/development/libraries/tbb/default.nix +10 −1 Original line number Diff line number Diff line Loading @@ -52,7 +52,16 @@ stdenv.mkDerivation rec { }) # Fix Threads::Threads target for static from https://github.com/oneapi-src/oneTBB/pull/1248 # This is a conflict-resolved cherry-pick of the above PR to due to formatting differences. ./patches/fix-cmake-threads-threads-target-for-static.patch (fetchpatch { name = "fix-cmake-threads-threads-target-for-static.patch"; url = "https://patch-diff.githubusercontent.com/raw/uxlfoundation/oneTBB/pull/1248.patch"; hash = "sha256-3WKzxU93vxuy7NgW+ap+ocZz5Q5utZ/pK7+FQExzLLA="; }) ]; patchFlags = [ "-p1" "--ignore-whitespace" ]; # Fix build with modern gcc Loading
pkgs/development/libraries/tbb/patches/fix-cmake-threads-threads-target-for-static.patchdeleted 100644 → 0 +0 −34 Original line number Diff line number Diff line From b42f074a724a41d2369a94283a2e94190d0cbb44 Mon Sep 17 00:00:00 2001 From: Liam Keegan <liam@keegan.ch> Date: Fri, 10 Nov 2023 09:08:42 +0100 Subject: [PATCH] Fix CMake "Threads::Threads target not found" issue for static builds (#1248) - add `Threads` dependency to installed CMake config for static builds only - based on #912 by @p12tic including reviewer comments from @ilya-lavrenov and @isaevil - resolves #1145 Signed-off-by: Liam Keegan <liam@keegan.ch> (cherry picked from commit 12ceae12138af08845b3e8c369b24527346fe99e) --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 16ee29ed..0bc39a52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -265,6 +265,10 @@ else() COMPONENT devel) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake "include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}Targets.cmake)\n") + if (NOT BUILD_SHARED_LIBS) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + "include(CMakeFindDependencyMacro)\nfind_dependency(Threads)\n") + endif() write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" COMPATIBILITY AnyNewerVersion) -- 2.49.0