mirror of
https://github.com/CachyOS/New-Cli-Installer.git
synced 2025-02-03 06:27:14 +08:00
18 lines
722 B
CMake
18 lines
722 B
CMake
#############################################################################
|
|
# one executable for each unit test file
|
|
#############################################################################
|
|
|
|
file(GLOB files unit-*.cpp)
|
|
|
|
foreach(file ${files})
|
|
get_filename_component(file_basename ${file} NAME_WE)
|
|
string(REGEX REPLACE "unit-([^$]+)" "test-\\1" testcase ${file_basename})
|
|
|
|
add_executable(${testcase} ${file})
|
|
target_compile_options(${testcase} PRIVATE
|
|
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated;-Wno-float-equal>
|
|
$<$<CXX_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
|
|
)
|
|
target_link_libraries(${testcase} PRIVATE project_warnings project_options gucc::gucc)
|
|
endforeach()
|