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
This commit is contained in:
Zhanyong Wan 2011-02-16 05:19:17 +00:00
Родитель 8fd0a5dfb0
Коммит 05cb9f2d61
1 изменённых файлов: 7 добавлений и 11 удалений

Просмотреть файл

@ -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
)