From 70f6ce5628d229a643ef33c89eca25ffd594c8b3 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 18 Apr 2021 13:37:18 +0100 Subject: [PATCH] Rename one of my cmake support functions. (NFC) add_platform_sources_to_library() is now called add_sources_from_current_dir(), so that it will make sense when I use it in subdirectories that aren't for a particular platform. --- cmake/setup.cmake | 2 +- unix/CMakeLists.txt | 26 +++++++++++++------------- windows/CMakeLists.txt | 24 ++++++++++++------------ 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cmake/setup.cmake b/cmake/setup.cmake index cc719cac..4bd599a4 100644 --- a/cmake/setup.cmake +++ b/cmake/setup.cmake @@ -55,7 +55,7 @@ add_custom_target(cmake_commit_c DEPENDS check_git_commit ${INTERMEDIATE_COMMIT_C} COMMENT "Updating cmake_commit.c") -function(add_platform_sources_to_library target) +function(add_sources_from_current_dir target) set(sources ${ARGN}) list(TRANSFORM sources PREPEND ${CMAKE_CURRENT_SOURCE_DIR}/) target_sources(${target} PRIVATE ${sources}) diff --git a/unix/CMakeLists.txt b/unix/CMakeLists.txt index ebb77a55..9a79f145 100644 --- a/unix/CMakeLists.txt +++ b/unix/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -add_platform_sources_to_library(utils +add_sources_from_current_dir(utils utils/arm_arch_queries.c utils/block_signal.c utils/cloexec.c @@ -23,25 +23,25 @@ add_platform_sources_to_library(utils # We want the ISO C implementation of ltime(), because we don't have # a local better alternative ../utils/ltime.c) -add_platform_sources_to_library(eventloop +add_sources_from_current_dir(eventloop uxcliloop.c uxsel.c) -add_platform_sources_to_library(console +add_sources_from_current_dir(console uxcons.c) -add_platform_sources_to_library(settings +add_sources_from_current_dir(settings uxstore.c) -add_platform_sources_to_library(network +add_sources_from_current_dir(network uxnet.c uxfdsock.c uxagentsock.c uxpeer.c uxproxy.c ux_x11.c) -add_platform_sources_to_library(sshcommon +add_sources_from_current_dir(sshcommon uxnoise.c) -add_platform_sources_to_library(sshclient +add_sources_from_current_dir(sshclient uxgss.c uxagentc.c uxshare.c) -add_platform_sources_to_library(sshserver +add_sources_from_current_dir(sshserver uxsftpserver.c procnet.c) -add_platform_sources_to_library(sftpclient +add_sources_from_current_dir(sftpclient uxsftp.c) -add_platform_sources_to_library(otherbackends +add_sources_from_current_dir(otherbackends uxser.c) -add_platform_sources_to_library(agent +add_sources_from_current_dir(agent uxagentc.c) add_executable(fuzzterm @@ -144,9 +144,9 @@ target_link_libraries(uppity eventloop sshserver keygen settings network crypto utils) if(GTK_FOUND) - add_platform_sources_to_library(utils + add_sources_from_current_dir(utils gtkcols.c) - add_platform_sources_to_library(guiterminal + add_sources_from_current_dir(guiterminal gtkwin.c gtkfont.c gtkdlg.c gtkcfg.c gtkcomm.c uxcfg.c uxucs.c uxprint.c) add_dependencies(guiterminal generated_licence_h) # gtkdlg.c uses licence.h diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt index e312f28f..d063b9d3 100644 --- a/windows/CMakeLists.txt +++ b/windows/CMakeLists.txt @@ -1,6 +1,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) -add_platform_sources_to_library(utils +add_sources_from_current_dir(utils utils/arm_arch_queries.c utils/capi.c utils/defaults.c @@ -28,27 +28,27 @@ add_platform_sources_to_library(utils utils/win_strerror.c winucs.c) if(NOT HAVE_STRTOUMAX) - add_platform_sources_to_library(utils utils/strtoumax.c) + add_sources_from_current_dir(utils utils/strtoumax.c) endif() -add_platform_sources_to_library(eventloop +add_sources_from_current_dir(eventloop wincliloop.c winhandl.c) -add_platform_sources_to_library(console +add_sources_from_current_dir(console winselcli.c winnohlp.c wincons.c) -add_platform_sources_to_library(settings +add_sources_from_current_dir(settings winstore.c) -add_platform_sources_to_library(network +add_sources_from_current_dir(network winnet.c winhsock.c winnpc.c winnps.c winproxy.c winx11.c) -add_platform_sources_to_library(sshcommon +add_sources_from_current_dir(sshcommon winnoise.c) -add_platform_sources_to_library(sshclient +add_sources_from_current_dir(sshclient winpgntc.c wingss.c winshare.c) -add_platform_sources_to_library(sftpclient +add_sources_from_current_dir(sftpclient winsftp.c) -add_platform_sources_to_library(otherbackends +add_sources_from_current_dir(otherbackends winser.c) -add_platform_sources_to_library(agent +add_sources_from_current_dir(agent winpgntc.c) -add_platform_sources_to_library(guiterminal +add_sources_from_current_dir(guiterminal windlg.c winctrls.c wincfg.c winprint.c winjump.c sizetip.c) add_dependencies(guiterminal generated_licence_h) # windlg.c uses licence.h