From 8f7db763ef7f30ec952bdb00adb6f99f980cb427 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 25 Mar 2022 09:47:08 -0700 Subject: [PATCH] [lldb] Conditionalize target_link_libraries on the target Fixes "Cannot specify link libraries for target "lldb-target-fuzzer" which is not built by this project." Normally that's taken care of by add_llvm_fuzzer but we need target_link_libraries for liblldb and our utility library. --- lldb/tools/lldb-fuzzer/CMakeLists.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lldb/tools/lldb-fuzzer/CMakeLists.txt b/lldb/tools/lldb-fuzzer/CMakeLists.txt index 44df5f193b44..b87e08720b59 100644 --- a/lldb/tools/lldb-fuzzer/CMakeLists.txt +++ b/lldb/tools/lldb-fuzzer/CMakeLists.txt @@ -9,9 +9,10 @@ add_llvm_fuzzer(lldb-target-fuzzer lldb-target-fuzzer.cpp ) -target_link_libraries(lldb-target-fuzzer - PRIVATE - liblldb - lldbFuzzerUtils - ) - +if(TARGET lldb-target-fuzzer) + target_link_libraries(lldb-target-fuzzer + PRIVATE + liblldb + lldbFuzzerUtils + ) +endif()