Skip to content

Commit

Permalink
Update TBB Cmake module finder
Browse files Browse the repository at this point in the history
Required for backward compatibility with older GNU LD version
(prior to 2.35)
  • Loading branch information
buddly27 committed May 9, 2024
1 parent 7325fc3 commit 9e3f32a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ main, dev ]

# Run tests once a week on Sunday.
schedule:
- cron: "0 6 * * 0"

permissions:
contents: read

Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ on:
pull_request:
branches: [ main, dev ]

# Run tests once a week on Sunday.
schedule:
- cron: "0 6 * * 0"

permissions:
contents: read

Expand Down
13 changes: 12 additions & 1 deletion cmake/modules/FindTBB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,21 @@ if(NOT TBB_FOUND)
# Create targets
##################################

# Linker scripts from TBB are not resolved correctly with older versions of
# GNU LD (before 2.35) when the 'INTERFACE_LINK_DIRECTORIES' property
# is not set.
set(TBB_LIBRARY_DIRS "")
foreach(lib ${TBB_LIBRARIES})
get_filename_component(dir ${lib} DIRECTORY)
list(APPEND TBB_LIBRARY_DIRS ${dir})
endforeach()
list(REMOVE_DUPLICATES TBB_LIBRARY_DIRS)

if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND)
add_library(TBB::tbb UNKNOWN IMPORTED)
set_target_properties(TBB::tbb PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS}
INTERFACE_LINK_DIRECTORIES ${TBB_LIBRARY_DIRS}
IMPORTED_LOCATION ${TBB_LIBRARIES})
if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG)
set_target_properties(TBB::tbb PROPERTIES
Expand All @@ -313,4 +324,4 @@ if(NOT TBB_FOUND)
unset(TBB_LIB_PATH_SUFFIX)
unset(TBB_DEFAULT_SEARCH_DIR)

endif()
endif()
7 changes: 7 additions & 0 deletions doc/sphinx/release/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
Release Notes
*************

.. release:: Upcoming

.. change:: fixed

Updated TBB CMake module finder to ensure proper resolution of linker
scripts on older versions of GNU LD (prior to 2.35).

.. release:: 0.6.0
:date: 2024-03-12

Expand Down

0 comments on commit 9e3f32a

Please sign in to comment.