From 4c85f68fe4c849c80895ac9da0a80370efdc2365 Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 18 Feb 2015 22:25:35 +0000 Subject: [PATCH] CMake: Fix add_lit_target for the case where a test suite has zero target dependencies. This can happen with a standalone project containing a test suite with no internal dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229753 91177308-0d34-0410-b5e6-96231b3b80d8 --- cmake/modules/AddLLVM.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index 4d081bd8651..780839d5c4f 100644 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -736,18 +736,20 @@ function(add_lit_target target comment) foreach(param ${ARG_PARAMS}) list(APPEND LIT_COMMAND --param ${param}) endforeach() - if( ARG_DEPENDS ) + if (ARG_DEFAULT_ARGS) add_custom_target(${target} COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS} COMMENT "${comment}" ${cmake_3_2_USES_TERMINAL} ) - add_dependencies(${target} ${ARG_DEPENDS}) else() add_custom_target(${target} COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, no tools built.") message(STATUS "${target} does nothing.") endif() + if (ARG_DEPENDS) + add_dependencies(${target} ${ARG_DEPENDS}) + endif() # Tests should be excluded from "Build Solution". set_target_properties(${target} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)