diff options
Diffstat (limited to 'cmake/modules')
-rwxr-xr-x | cmake/modules/AddLLVM.cmake | 8 | ||||
-rw-r--r-- | cmake/modules/LLVMProcessSources.cmake | 7 |
2 files changed, 8 insertions, 7 deletions
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake index f32a6d3..96246fa 100755 --- a/cmake/modules/AddLLVM.cmake +++ b/cmake/modules/AddLLVM.cmake @@ -149,14 +149,12 @@ macro(add_llvm_external_project name) endmacro(add_llvm_external_project) # Generic support for adding a unittest. -function(add_unittest test_suite test_dirname) - string(REGEX MATCH "([^/]+)$" test_name ${test_dirname}) +function(add_unittest test_suite test_name) if (CMAKE_BUILD_TYPE) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname}/${CMAKE_BUILD_TYPE}) + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}) else() - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY - ${CMAKE_CURRENT_BINARY_DIR}/${test_dirname}) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) endif() if( NOT LLVM_BUILD_TESTS ) set(EXCLUDE_FROM_ALL ON) diff --git a/cmake/modules/LLVMProcessSources.cmake b/cmake/modules/LLVMProcessSources.cmake index 641f1b3..bb11e9c 100644 --- a/cmake/modules/LLVMProcessSources.cmake +++ b/cmake/modules/LLVMProcessSources.cmake @@ -81,10 +81,13 @@ function(llvm_check_source_file_list) file(GLOB globbed *.cpp) foreach(g ${globbed}) get_filename_component(fn ${g} NAME) - list(FIND listed ${fn} idx) + list(FIND LLVM_OPTIONAL_SOURCES ${fn} idx) if( idx LESS 0 ) - message(SEND_ERROR "Found unknown source file ${g} + list(FIND listed ${fn} idx) + if( idx LESS 0 ) + message(SEND_ERROR "Found unknown source file ${g} Please update ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt\n") + endif() endif() endforeach() endfunction(llvm_check_source_file_list) |