From: Zhanyong Wan Date: Wed, 16 Feb 2011 05:19:17 +0000 (+0000) Subject: Improves CMakeLists.txt for Clang's unit tests: make "linked X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05cb9f2d61a0c5efa78ea43bc87685fd85c81c6c;p=clang Improves CMakeLists.txt for Clang's unit tests: make "linked components" and "used libs" arguments of add_clang_unittest(). Reviewed by jyasskin and chapuni. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125652 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt index c7c773348f..b001d15bcb 100644 --- a/unittests/CMakeLists.txt +++ b/unittests/CMakeLists.txt @@ -1,4 +1,8 @@ -function(add_clang_unittest test_dirname) +function(add_clang_unittest test_dirname link_components used_libs) + separate_arguments(link_components) + set(LLVM_LINK_COMPONENTS ${link_components}) + separate_arguments(used_libs) + set(LLVM_USED_LIBS ${used_libs}) string(REGEX MATCH "([^/]+)$" test_name ${test_dirname}) if (CMAKE_BUILD_TYPE) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY @@ -32,16 +36,8 @@ if(SUPPORTS_NO_VARIADIC_MACROS_FLAG) add_definitions("-Wno-variadic-macros") endif() -set(LLVM_LINK_COMPONENTS - Core - ) - -set(LLVM_USED_LIBS - gtest - gtest_main - clangFrontend - ) - add_clang_unittest(Frontend + "Core" + "gtest gtest_main clangFrontend" Frontend/FrontendActionTest.cpp )