Skip to content

Commit

Permalink
Add target existence check in DyninstTBB
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Dec 22, 2022
1 parent ea4a9bd commit 764e296
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cmake/tpls/DyninstTBB.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ find_package(
COMPONENTS tbb tbbmalloc tbbmalloc_proxy
REQUIRED)

# Make an interface dummy target to force includes to be treated as SYSTEM
add_library(Dyninst::TBB INTERFACE IMPORTED)
target_link_libraries(Dyninst::TBB INTERFACE TBB::tbb TBB::tbbmalloc TBB::tbbmalloc_proxy)
target_include_directories(
Dyninst::TBB SYSTEM
INTERFACE $<TARGET_PROPERTY:TBB::tbb,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:TBB::tbbmalloc,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:TBB::tbbmalloc_proxy,INTERFACE_INCLUDE_DIRECTORIES>)
if(NOT TARGET Dyninst::TBB)
add_library(Dyninst::TBB INTERFACE IMPORTED)
target_link_libraries(Dyninst::TBB INTERFACE TBB::tbb TBB::tbbmalloc TBB::tbbmalloc_proxy)
target_include_directories(
Dyninst::TBB SYSTEM
INTERFACE $<TARGET_PROPERTY:TBB::tbb,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:TBB::tbbmalloc,INTERFACE_INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:TBB::tbbmalloc_proxy,INTERFACE_INCLUDE_DIRECTORIES>)
endif()

message(STATUS "Found TBB ${TBB_VERSION}")
get_target_property(_tmp TBB::tbb INTERFACE_INCLUDE_DIRECTORIES)
Expand Down

0 comments on commit 764e296

Please sign in to comment.