From aadab8b2525ba797a5bce836e9e9c610bb88272a Mon Sep 17 00:00:00 2001 From: Mark Dokter Date: Tue, 1 Oct 2024 11:35:58 +0200 Subject: [PATCH] [DAPHNE-#830] Silence warning when using LLD With this new CMake configuration, we silence a lot of warnings when using the LLD linker in combination with clang: ``clang++: warning: argument unused during compilation: '-fuse-ld=lld' [-Wunused-command-line-argument]`` A CMake version bump to 3.29 is necessary for this config option. Ubuntu 24 users need to switch to the snap version of CMake. The Docker images already provide CMake 3.30 --- CMakeLists.txt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b806d4c84..50ee424e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.25.2) +cmake_minimum_required(VERSION 3.29) # Build release version by default (override with -DCMAKE_BUILD_TYPE=Debug in your initial cmake invocation) # This needs to be set *before* the project() command @@ -152,9 +152,8 @@ endif() find_program(LLD_PROGRAM lld) if(LLD_PROGRAM) - message(STATUS "Using lld") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=lld") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=lld") + set(CMAKE_LINKER_TYPE LLD) + message(STATUS "Using lld - LINKER_TYPE: ${CMAKE_LINKER_TYPE}") endif() find_package(Arrow REQUIRED)