mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-02 21:31:41 +00:00
CMake: factor out a function that returns the expected directory for unit test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170539 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8963fecc86
commit
828df0fda8
@ -155,14 +155,20 @@ macro(add_llvm_external_project name)
|
||||
endif()
|
||||
endmacro(add_llvm_external_project)
|
||||
|
||||
# Returns directory where unittest should reside.
|
||||
function(get_unittest_directory dir)
|
||||
if (CMAKE_BUILD_TYPE)
|
||||
set(result ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
|
||||
else()
|
||||
set(result ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
set(${dir} ${result} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# Generic support for adding a unittest.
|
||||
function(add_unittest test_suite test_name)
|
||||
if (CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
|
||||
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE})
|
||||
else()
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||
endif()
|
||||
get_unittest_directory(OUTPUT_DIR)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR})
|
||||
if( NOT LLVM_BUILD_TESTS )
|
||||
set(EXCLUDE_FROM_ALL ON)
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user