From d5b2fd9d2f4b02dfda5897524eeb3753d20d0ede Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 26 Jul 2023 08:11:29 +0100 Subject: [PATCH] Unix: conditionalise test_lineedit and test_terminal. If we don't have GTK enabled in the build, then lots of important stuff never gets added to the 'guiterminal' build-time object library, without which these terminal-using programs can't link successfully, even though they don't actually use GTK. I could add yet more stub functions, but I don't think that's really necessary - it doesn't seem like a serious inconvenience that you can only test the terminal on a platform where you can also build real applications that include it. So I've just moved those two executable file definitions inside the Big If that conditionalises PuTTY and pterm themselves. --- unix/CMakeLists.txt | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/unix/CMakeLists.txt b/unix/CMakeLists.txt index 0fd96e60..d85b19a5 100644 --- a/unix/CMakeLists.txt +++ b/unix/CMakeLists.txt @@ -202,6 +202,24 @@ if(GTK_FOUND) guiterminal eventloop otherbackends settings network charset utils puttyxpms ${GTK_LIBRARIES} ${X11_LIBRARIES}) + + add_executable(test_lineedit + ${CMAKE_SOURCE_DIR}/test/test_lineedit.c + ${CMAKE_SOURCE_DIR}/stubs/no-gss.c + ${CMAKE_SOURCE_DIR}/stubs/no-logging.c + ${CMAKE_SOURCE_DIR}/stubs/no-printing.c + ${CMAKE_SOURCE_DIR}/stubs/no-storage.c + ${CMAKE_SOURCE_DIR}/stubs/no-timing.c) + target_link_libraries(test_lineedit + guiterminal settings eventloop charset utils ${platform_libraries}) + + add_executable(test_terminal + ${CMAKE_SOURCE_DIR}/test/test_terminal.c + ${CMAKE_SOURCE_DIR}/stubs/no-gss.c + ${CMAKE_SOURCE_DIR}/stubs/no-storage.c + ${CMAKE_SOURCE_DIR}/stubs/no-timing.c) + target_link_libraries(test_terminal + guiterminal settings eventloop charset utils ${platform_libraries}) endif() # Pageant is built whether we have GTK or not; in its absence we @@ -226,21 +244,3 @@ target_link_libraries(pageant eventloop console agent settings network crypto utils ${pageant_libs}) installed_program(pageant) - -add_executable(test_lineedit - ${CMAKE_SOURCE_DIR}/test/test_lineedit.c - ${CMAKE_SOURCE_DIR}/stubs/no-gss.c - ${CMAKE_SOURCE_DIR}/stubs/no-logging.c - ${CMAKE_SOURCE_DIR}/stubs/no-printing.c - ${CMAKE_SOURCE_DIR}/stubs/no-storage.c - ${CMAKE_SOURCE_DIR}/stubs/no-timing.c) -target_link_libraries(test_lineedit - guiterminal settings eventloop charset utils ${platform_libraries}) - -add_executable(test_terminal - ${CMAKE_SOURCE_DIR}/test/test_terminal.c - ${CMAKE_SOURCE_DIR}/stubs/no-gss.c - ${CMAKE_SOURCE_DIR}/stubs/no-storage.c - ${CMAKE_SOURCE_DIR}/stubs/no-timing.c) -target_link_libraries(test_terminal - guiterminal settings eventloop charset utils ${platform_libraries})