mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
Add CMake support
This commit is contained in:
16
cmake/swift_test.cmake
Normal file
16
cmake/swift_test.cmake
Normal file
@@ -0,0 +1,16 @@
|
||||
# SPDX-FileCopyrightText: Copyright (C) swift Project Community / Contributors
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
|
||||
|
||||
function(add_swift_test)
|
||||
set(single_args NAME)
|
||||
set(multi_args SOURCES LINK_LIBRARIES)
|
||||
cmake_parse_arguments(SWIFT_TEST "" "${single_args}" "${multi_args}" ${ARGN})
|
||||
|
||||
add_executable(tests_${SWIFT_TEST_NAME} ${SWIFT_TEST_SOURCES})
|
||||
target_link_libraries(tests_${SWIFT_TEST_NAME} PUBLIC ${SWIFT_TEST_LINK_LIBRARIES})
|
||||
add_test(NAME ${SWIFT_TEST_NAME} COMMAND tests_${SWIFT_TEST_NAME})
|
||||
|
||||
if(WIN32)
|
||||
add_dependencies(tests_${SWIFT_TEST_NAME} copy_externals_to_build_dir)
|
||||
endif()
|
||||
endfunction()
|
||||
Reference in New Issue
Block a user