From 5b5b4a5718fc6996091ebdec7c06b8ff6ed816da Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Mon, 14 Dec 2020 15:43:49 +0100 Subject: [PATCH] Conditionally link `exception_tracer` libs --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7316ffb..cd58ae5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -361,8 +361,11 @@ target_link_libraries( foreach(tgt ${BINARY_TARGETS}) target_link_libraries(${tgt} dwarfs) - target_link_libraries(${tgt} -Wl,--whole-archive folly_exception_tracer_base - folly_exception_tracer -Wl,--no-whole-archive) + if(TARGET folly_exception_tracer) + target_link_libraries( + ${tgt} -Wl,--whole-archive folly_exception_tracer_base + folly_exception_tracer -Wl,--no-whole-archive) + endif() endforeach() if(WITH_PYTHON)