llvm.org GIT mirror llvm / 84b1665
CMake: Stop using LLVM's custom parse_arguments. NFC Summary: Use CMake's cmake_parse_arguments() instead. It's called in a slightly different way, but supports all our use cases. It's in CMake 2.8.8, which is our minimum supported version. CMake 3.0 doc (roughly the same. No direct link to 2.8.8 doc): http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html?highlight=cmake_parse_arguments Reviewers: pcc, beanz, chapuni Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10531 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240121 91177308-0d34-0410-b5e6-96231b3b80d8 Filipe Cabecinhas 4 years ago
1 changed file(s) with 7 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
None include(LLVMParseArguments)
1 include(LLVMProcessSources)
21 include(LLVM-Config)
32
846845 # A raw function to create a lit target. This is used to implement the testuite
847846 # management functions.
848847 function(add_lit_target target comment)
849 parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
848 cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
850849 set(LIT_ARGS "${ARG_ARGS} ${LLVM_LIT_ARGS}")
851850 separate_arguments(LIT_ARGS)
852851 if (NOT CMAKE_CFG_INTDIR STREQUAL ".")
861860 foreach(param ${ARG_PARAMS})
862861 list(APPEND LIT_COMMAND --param ${param})
863862 endforeach()
864 if (ARG_DEFAULT_ARGS)
863 if (ARG_UNPARSED_ARGUMENTS)
865864 add_custom_target(${target}
866 COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS}
865 COMMAND ${LIT_COMMAND} ${ARG_UNPARSED_ARGUMENTS}
867866 COMMENT "${comment}"
868867 ${cmake_3_2_USES_TERMINAL}
869868 )
882881
883882 # A function to add a set of lit test suites to be driven through 'check-*' targets.
884883 function(add_lit_testsuite target comment)
885 parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
884 cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
886885
887886 # EXCLUDE_FROM_ALL excludes the test ${target} out of check-all.
888887 if(NOT EXCLUDE_FROM_ALL)
889888 # Register the testsuites, params and depends for the global check rule.
890 set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${ARG_DEFAULT_ARGS})
889 set_property(GLOBAL APPEND PROPERTY LLVM_LIT_TESTSUITES ${ARG_UNPARSED_ARGUMENTS})
891890 set_property(GLOBAL APPEND PROPERTY LLVM_LIT_PARAMS ${ARG_PARAMS})
892891 set_property(GLOBAL APPEND PROPERTY LLVM_LIT_DEPENDS ${ARG_DEPENDS})
893892 set_property(GLOBAL APPEND PROPERTY LLVM_LIT_EXTRA_ARGS ${ARG_ARGS})
895894
896895 # Produce a specific suffixed check rule.
897896 add_lit_target(${target} ${comment}
898 ${ARG_DEFAULT_ARGS}
897 ${ARG_UNPARSED_ARGUMENTS}
899898 PARAMS ${ARG_PARAMS}
900899 DEPENDS ${ARG_DEPENDS}
901900 ARGS ${ARG_ARGS}
904903
905904 function(add_lit_testsuites project directory)
906905 if (NOT CMAKE_CONFIGURATION_TYPES)
907 parse_arguments(ARG "PARAMS;DEPENDS;ARGS" "" ${ARGN})
906 cmake_parse_arguments(ARG "" "" "PARAMS;DEPENDS;ARGS" ${ARGN})
908907 file(GLOB_RECURSE litCfg ${directory}/lit*.cfg)
909908 set(lit_suites)
910909 foreach(f ${litCfg})