Skip to content

Commit 627a12f

Browse files
authored
Merge pull request ceph#62663 from adamemerson/wip-tbb-O0
build: Pull TBB into `$EXTRALIBS` if it is available Reviewed-by: Kefu Chai <[email protected]>
2 parents 068e292 + dc824ec commit 627a12f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/common/io_exerciser/CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,17 @@ target_link_libraries(object_io_exerciser
1212
librados
1313
global
1414
json_structures
15-
)
15+
)
16+
17+
# libstdc++ uses TBB to implement <execution> if it is available,
18+
# which means that if we're going to use <execution>, we need to link
19+
# against TBB if it's available.
20+
#
21+
# It happens to work by accident at present because the optimizer
22+
# optimizes out our one reference, for now, but this breaks compiling
23+
# with `-O0` and will break anyway once we try to do more.
24+
find_package(TBB QUIET)
25+
if(TBB_FOUND)
26+
message(STATUS "Linking to TBB for implementations of <execution>.")
27+
target_link_libraries(object_io_exerciser TBB::tbb)
28+
endif(TBB_FOUND)

0 commit comments

Comments
 (0)