From fc6003c74ecf04aeb714ebde2b0922271802bba6 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 14 Sep 2025 15:50:50 +0100 Subject: [PATCH] cmake: consolidate libm library handling Move the handling to the top-level, adding it _once_ to EXTRA_LIBS. Thus avoiding some duplication across the board. This change technically adds an extra link for the unit tests, which seemingly was omitted by mistake. Alternatively, the extra over-linking won't be an issue in practise. Signed-off-by: Emil Velikov --- CMakeLists.txt | 2 ++ src/gui/curses/CMakeLists.txt | 2 -- tests/fuzz/CMakeLists.txt | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bed6c2b44..80e213221 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -311,6 +311,8 @@ else() add_custom_target(translations COMMAND true) endif() +list(APPEND EXTRA_LIBS "m") + add_subdirectory(src) add_subdirectory(doc) diff --git a/src/gui/curses/CMakeLists.txt b/src/gui/curses/CMakeLists.txt index 2223a33e7..1ec67614b 100644 --- a/src/gui/curses/CMakeLists.txt +++ b/src/gui/curses/CMakeLists.txt @@ -37,8 +37,6 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") list(APPEND EXTRA_LIBS "pthread") endif() -list(APPEND EXTRA_LIBS "m") - if(ENABLE_NCURSES) subdirs(normal) endif() diff --git a/tests/fuzz/CMakeLists.txt b/tests/fuzz/CMakeLists.txt index 54e5384bc..8d11137e6 100644 --- a/tests/fuzz/CMakeLists.txt +++ b/tests/fuzz/CMakeLists.txt @@ -56,8 +56,6 @@ if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Haiku") list(APPEND EXTRA_LIBS "pthread") endif() -list(APPEND EXTRA_LIBS "m") - if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # link with resolv lib on macOS list(APPEND EXTRA_LIBS "resolv")