1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

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.

llvm-svn: 229753
This commit is contained in:
Peter Collingbourne 2015-02-18 22:25:35 +00:00
parent 94f35587d1
commit 604243217b

View File

@ -736,18 +736,20 @@ function(add_lit_target target comment)
foreach(param ${ARG_PARAMS}) foreach(param ${ARG_PARAMS})
list(APPEND LIT_COMMAND --param ${param}) list(APPEND LIT_COMMAND --param ${param})
endforeach() endforeach()
if( ARG_DEPENDS ) if (ARG_DEFAULT_ARGS)
add_custom_target(${target} add_custom_target(${target}
COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS} COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS}
COMMENT "${comment}" COMMENT "${comment}"
${cmake_3_2_USES_TERMINAL} ${cmake_3_2_USES_TERMINAL}
) )
add_dependencies(${target} ${ARG_DEPENDS})
else() else()
add_custom_target(${target} add_custom_target(${target}
COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, no tools built.") COMMAND ${CMAKE_COMMAND} -E echo "${target} does nothing, no tools built.")
message(STATUS "${target} does nothing.") message(STATUS "${target} does nothing.")
endif() endif()
if (ARG_DEPENDS)
add_dependencies(${target} ${ARG_DEPENDS})
endif()
# Tests should be excluded from "Build Solution". # Tests should be excluded from "Build Solution".
set_target_properties(${target} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON) set_target_properties(${target} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)