Skip to content

Commit

Permalink
Require CMake package for TBB (#1322)
Browse files Browse the repository at this point in the history
* Make libdl/dbghelp private linkage

* Remove TBB flags from toolkits that don't use TBB

* Remove FindTBB.cmake

All supported TBB versions ship as CMake packages, so this is no longer
needed.

* Remove from-source build option

* Create an imported target for TBB used by Dyninst

This is needed to force the include directories to be considered 'system' directories so that compiler warnings from TBB sources are ignored

* Rename cmake/ThreadingBuildingBlocks.cmake -> cmake/tpls/DyninstTBB.cmake

This is needed to keep the namespace clean for DyninstConfig.cmake

* Export TBB as part of the Dyninst CMake package

This is required by the CMake guidelines:
  https://cmake.org/cmake/help/latest/guide/importing-exporting/index.html

In particular,
  "All required dependencies of a package must also be found in the package configuration file"

* Format DyninstTBB.cmake
  • Loading branch information
hainest committed Dec 2, 2022
1 parent 805291b commit e334905
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 527 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ include(DyninstLanguageStandards)
# Find the necessary third-party libraries
find_package(Thread_DB)
find_package(Threads)

include(DyninstBoost)
include(DyninstTBB)
include(DyninstElfUtils)
Expand Down Expand Up @@ -76,7 +77,7 @@ if(ADD_VALGRIND_ANNOTATIONS)
add_definitions(-DENABLE_VG_ANNOTATIONS)
endif()

include_directories(${DYNINST_ROOT} ${DYNINST_ROOT}/external ${TBB_INCLUDE_DIRS})
include_directories(${DYNINST_ROOT} ${DYNINST_ROOT}/external)

# Component time
add_subdirectory(common)
Expand Down
2 changes: 2 additions & 0 deletions cmake/DyninstConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# DYNINST_LIBRARIES
# DYNINST_INTERNAL_DEFINES - used by the test suite

include(DyninstTBB)

# compute paths

get_filename_component(DYNINST_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
Expand Down
297 changes: 0 additions & 297 deletions cmake/Modules/FindTBB.cmake

This file was deleted.

0 comments on commit e334905

Please sign in to comment.