[lldb] Only add lldb-framework-cleanup dependency to existing targets
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 11 Jan 2023 00:22:07 +0000 (16:22 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 11 Jan 2023 00:23:43 +0000 (16:23 -0800)
The Xcode standalone build doesn't have the install-liblldb and
install-liblldb-stripped targets. Fix the resulting CMake error "Cannot
add target-level dependencies to non-existent target" by only adding the
dependency when the targets exist.

lldb/source/API/CMakeLists.txt

index f3c8814..3e189f3 100644 (file)
@@ -212,8 +212,13 @@ endif()
 if(LLDB_BUILD_FRAMEWORK)
   include(LLDBFramework)
 
-  add_dependencies(install-liblldb
-    lldb-framework-cleanup)
-  add_dependencies(install-liblldb-stripped
-    lldb-framework-cleanup)
+  if (TARGET install-liblldb)
+    add_dependencies(install-liblldb
+      lldb-framework-cleanup)
+  endif()
+
+  if (TARGET install-liblldb-stripped)
+    add_dependencies(install-liblldb-stripped
+      lldb-framework-cleanup)
+  endif()
 endif()