Fix running tests in Windows builds
Arch Linux AUR Success Details
Alpine 3.19 Success Details

This commit is contained in:
Přemysl Eric Janouch 2024-04-10 12:48:05 +02:00
parent 33426992ec
commit 2fe846f09f
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 3 additions and 3 deletions

View File

@ -78,7 +78,7 @@ if (USE_SYSTEM_TERMO)
if (NOT Termo_FOUND) if (NOT Termo_FOUND)
message (FATAL_ERROR "System termo library not found") message (FATAL_ERROR "System termo library not found")
endif () endif ()
else () elseif (NOT WIN32)
# We don't want the library to install, but EXCLUDE_FROM_ALL ignores tests # We don't want the library to install, but EXCLUDE_FROM_ALL ignores tests
add_subdirectory (termo EXCLUDE_FROM_ALL) add_subdirectory (termo EXCLUDE_FROM_ALL)
file (WRITE ${PROJECT_BINARY_DIR}/CTestCustom.cmake file (WRITE ${PROJECT_BINARY_DIR}/CTestCustom.cmake
@ -238,7 +238,7 @@ if (WIN32)
set_property (SOURCE ${resource_file} set_property (SOURCE ${resource_file}
APPEND PROPERTY OBJECT_DEPENDS ${icon_ico}) APPEND PROPERTY OBJECT_DEPENDS ${icon_ico})
else () else ()
list (APPEND project_libraries ${Ncursesw_LIBRARIES} termo-static) list (APPEND project_libraries ${Ncursesw_LIBRARIES} ${Termo_LIBRARIES})
list (APPEND project_sources list (APPEND project_sources
src/${PROJECT_NAME}-tui.c) src/${PROJECT_NAME}-tui.c)
endif () endif ()
@ -383,7 +383,7 @@ if (BUILD_TESTING)
add_executable (test-${name} add_executable (test-${name}
src/test-${name}.c ${project_common_sources}) src/test-${name}.c ${project_common_sources})
target_link_libraries (test-${name} ${project_common_libraries}) target_link_libraries (test-${name} ${project_common_libraries})
add_test (test-${name} test-${name}) add_test (NAME test-${name} COMMAND test-${name})
endforeach () endforeach ()
endif () endif ()