From 774da3752bbc583bf1daa6fcb67480c1b4c7513f Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Thu, 25 Aug 2016 17:18:41 +0000 Subject: Hooking up a check-all target for the runtimes projects git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279756 91177308-0d34-0410-b5e6-96231b3b80d8 --- runtimes/CMakeLists.txt | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'runtimes') diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt index bbdebff2e5e..2d84f47260e 100644 --- a/runtimes/CMakeLists.txt +++ b/runtimes/CMakeLists.txt @@ -37,7 +37,7 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) # Setting these variables will allow the sub-build to put their outputs into # the library and bin directories of the top-level build. set(LLVM_LIBRARY_OUTPUT_INTDIR ${LLVM_LIBRARY_DIR}) - set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_BINARY_DIR}) + set(LLVM_RUNTIME_OUTPUT_INTDIR ${LLVM_TOOLS_BINARY_DIR}) foreach(entry ${runtimes}) get_filename_component(projName ${entry} NAME) @@ -52,9 +52,37 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) # will be included under here. set(HAVE_${canon_name} On) + # Between each sub-project we want to cache and clear the LIT properties + set_property(GLOBAL PROPERTY LLVM_LIT_TESTSUITES) + set_property(GLOBAL PROPERTY LLVM_LIT_PARAMS) + set_property(GLOBAL PROPERTY LLVM_LIT_DEPENDS) + set_property(GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS) + add_subdirectory(${projName}) + + get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES) + get_property(LLVM_LIT_PARAMS GLOBAL PROPERTY LLVM_LIT_PARAMS) + get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS) + get_property(LLVM_LIT_EXTRA_ARGS GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS) + + list(APPEND RUNTIMES_LIT_TESTSUITES ${LLVM_LIT_TESTSUITES}) + list(APPEND RUNTIMES_LIT_PARAMS ${LLVM_LIT_PARAMS}) + list(APPEND RUNTIMES_LIT_DEPENDS ${LLVM_LIT_DEPENDS}) + list(APPEND RUNTIMES_LIT_EXTRA_ARGS ${LLVM_LIT_EXTRA_ARGS}) endforeach() + # Add a global check rule now that all subdirectories have been traversed + # and we know the total set of lit testsuites. + + add_lit_target(check-runtimes + "Running all regression tests" + ${RUNTIMES_LIT_TESTSUITES} + PARAMS ${RUNTIMES_LIT_PARAMS} + DEPENDS ${RUNTIMES_LIT_DEPENDS} + ARGS ${RUNTIMES_LIT_EXTRA_ARGS} + ) + add_custom_target(test-depends-runtimes DEPENDS ${RUNTIMES_LIT_DEPENDS}) + else() # if this is included from LLVM's CMake include(LLVMExternalProjectUtils) @@ -86,6 +114,14 @@ else() # if this is included from LLVM's CMake endforeach() if(runtimes) + + foreach(runtime_name ${runtime_names}) + list(APPEND extra_targets + ${runtime_name} + install-${runtime_name} + check-${runtime_name}) + endforeach() + # Create a runtimes target that uses this file as its top-level CMake file. # The runtimes target is a configuration of all the runtime libraries # together in a single CMake invocaiton. @@ -95,7 +131,11 @@ else() # if this is included from LLVM's CMake # Builtins were built separately above CMAKE_ARGS -DCOMPILER_RT_BUILD_BUILTINS=Off PASSTHROUGH_PREFIXES ${prefixes} - EXTRA_TARGETS ${runtime_names} + EXTRA_TARGETS ${extra_targets} + test-depends-runtimes + check-runtimes USE_TOOLCHAIN) + set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS test-depends-runtimes) + endif() endif() -- cgit v1.2.3