From a776fb1867b92dee37c1a6c58de499087c98050c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 21 Dec 2024 15:03:21 +0100 Subject: [PATCH] core: fix detection of dl library This fixes the linking to curl and ncurses on macOS. --- CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5d15a35489f..d235060983a 100644 --- CMakeLists.txt +++ CMakeLists.txt @@ -247,9 +247,7 @@ find_library(DL_LIBRARY PATHS /lib /usr/lib /usr/libexec /usr/local/lib /usr/local/libexec ) if(DL_LIBRARY) - string(REGEX REPLACE "/[^/]*$" "" DL_LIBRARY_PATH "${DL_LIBRARY}") - set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -L${DL_LIBRARY_PATH}") - list(APPEND EXTRA_LIBS dl) + list(APPEND EXTRA_LIBS ${DL_LIBRARY}) endif() add_subdirectory(icons) From c73fcbfd3310998c4488af6bdd1fbc4b72604d76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 21 Dec 2024 14:42:12 +0100 Subject: [PATCH] core: add option POST_BUILD in add_custom_command This fixes the following CMake warning: CMake Warning (dev) at src/gui/curses/normal/CMakeLists.txt:73 (add_custom_command): Exactly one of PRE_BUILD, PRE_LINK, or POST_BUILD must be given. Assuming POST_BUILD to preserve backward compatibility. Policy CMP0175 is not set: add_custom_command() rejects invalid arguments. Run "cmake --help-policy CMP0175" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it. --- src/gui/curses/normal/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/curses/normal/CMakeLists.txt b/src/gui/curses/normal/CMakeLists.txt index 1716905a809..43c48de74c8 100644 --- src/gui/curses/normal/CMakeLists.txt +++ src/gui/curses/normal/CMakeLists.txt @@ -72,6 +72,7 @@ target_link_libraries(${EXECUTABLE} # It may be removed in future. add_custom_command( TARGET ${EXECUTABLE} + POST_BUILD COMMAND ${CMAKE_COMMAND} -E remove -f "weechat-curses${CMAKE_EXECUTABLE_SUFFIX}" COMMAND ${CMAKE_COMMAND} -E create_symlink "weechat${CMAKE_EXECUTABLE_SUFFIX}" "weechat-curses${CMAKE_EXECUTABLE_SUFFIX}" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"