[Lldb-commits] [lldb] r359490 - [CMake] Fix subtle CMake bug

Alex Langford via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 29 12:44:43 PDT 2019


Author: xiaobai
Date: Mon Apr 29 12:44:43 2019
New Revision: 359490

URL: http://llvm.org/viewvc/llvm-project?rev=359490&view=rev
Log:
[CMake] Fix subtle CMake bug

CMake specifies that the DEPENDS field of add_custom_target is for files
and output of add_custom_command. In order to add a target dependency,
add_dependencies should be used.

Modified:
    lldb/trunk/CMakeLists.txt
    lldb/trunk/cmake/modules/AddLLDB.cmake
    lldb/trunk/docs/CMakeLists.txt
    lldb/trunk/test/CMakeLists.txt

Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=359490&r1=359489&r2=359490&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Apr 29 12:44:43 2019
@@ -133,7 +133,8 @@ if(LLDB_INCLUDE_TESTS)
     list(APPEND LLDB_TEST_DEPS dsymutil)
   endif()
 
-  add_custom_target(lldb-test-deps DEPENDS ${LLDB_TEST_DEPS})
+  add_custom_target(lldb-test-deps)
+  add_dependencies(lldb-test-deps ${LLDB_TEST_DEPS})
 
   add_subdirectory(test)
   add_subdirectory(unittests)

Modified: lldb/trunk/cmake/modules/AddLLDB.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/AddLLDB.cmake?rev=359490&r1=359489&r2=359490&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/AddLLDB.cmake (original)
+++ lldb/trunk/cmake/modules/AddLLDB.cmake Mon Apr 29 12:44:43 2019
@@ -83,7 +83,7 @@ function(add_lldb_library name)
       endif()
       if (NOT CMAKE_CONFIGURATION_TYPES)
         add_llvm_install_targets(install-${name}
-                                 DEPENDS $<TARGET_FILE:${name}>
+                                 DEPENDS ${name}
                                  COMPONENT ${name})
       endif()
     endif()

Modified: lldb/trunk/docs/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/CMakeLists.txt?rev=359490&r1=359489&r2=359490&view=diff
==============================================================================
--- lldb/trunk/docs/CMakeLists.txt (original)
+++ lldb/trunk/docs/CMakeLists.txt Mon Apr 29 12:44:43 2019
@@ -32,8 +32,8 @@ if(EPYDOC_EXECUTABLE)
   get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
   add_custom_target(lldb-python-doc-package
     COMMAND "${CMAKE_COMMAND}" -E copy "${lldb_scripts_dir}/lldb.py" "${CMAKE_CURRENT_BINARY_DIR}/lldb/__init__.py"
-    DEPENDS swig_wrapper
     COMMENT "Copying lldb.py to pretend package.")
+  add_dependencies(lldb-python-doc-package swig_wrapper)
 
   set(DOC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/doc")
   file(MAKE_DIRECTORY "${DOC_DIR}")
@@ -45,11 +45,10 @@ if(EPYDOC_EXECUTABLE)
     --name "LLDB python API"
     --url "http://lldb.llvm.org"
     ${EPYDOC_OPTIONS}
-    DEPENDS swig_wrapper
-    DEPENDS lldb-python-doc-package
     WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
     COMMENT "Generating LLDB Python API reference with epydoc" VERBATIM
   )
+  add_dependencies(lldb-python-doc swig_wrapper lldb-python-doc-package)
 else()
   message(STATUS "Could NOT find epydoc")
 endif()

Modified: lldb/trunk/test/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/CMakeLists.txt?rev=359490&r1=359489&r2=359490&view=diff
==============================================================================
--- lldb/trunk/test/CMakeLists.txt (original)
+++ lldb/trunk/test/CMakeLists.txt Mon Apr 29 12:44:43 2019
@@ -8,9 +8,9 @@ function(add_python_test_target name tes
   add_custom_target(${name}
     COMMAND ${PYTHON_TEST_COMMAND} ${ARG_DEFAULT_ARGS}
     COMMENT "${comment}"
-    DEPENDS ${LLDB_TEST_DEPS}
     USES_TERMINAL
     )
+  add_dependencies(${name} ${LLDB_TEST_DEPS})
 endfunction()
 
 # The default architecture with which to compile test executables is the default LLVM target




More information about the lldb-commits mailing list