From e2a8b0adbd099cfda84e931f6a24f34e80b12fd7 Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Sat, 7 May 2022 20:51:25 +0300 Subject: [PATCH] Hardcode atomic_LIB as -latomic find_library does not always work because libatomic.so may be in a path like /usr/lib/gcc/x86_64-linux-gnu/11/libatomic.so, which CMake does not consider by default. Pick-to: 6.3 Change-Id: I73a657c470efa4f84f8629bd531edfcac3b3a352 Reviewed-by: Alexey Edelev Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot Reviewed-by: Jörg Bornemann --- cmake/FindWrapAtomic.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindWrapAtomic.cmake b/cmake/FindWrapAtomic.cmake index 3ea72bb188..006be0ed8f 100644 --- a/cmake/FindWrapAtomic.cmake +++ b/cmake/FindWrapAtomic.cmake @@ -33,7 +33,7 @@ int main(int, char **) check_cxx_source_compiles("${atomic_test_sources}" HAVE_STDATOMIC) if(NOT HAVE_STDATOMIC) set(_req_libraries "${CMAKE_REQUIRED_LIBRARIES}") - find_library(atomic_LIB atomic REQUIRED) + set(atomic_LIB "-latomic") set(CMAKE_REQUIRED_LIBRARIES ${atomic_LIB}) check_cxx_source_compiles("${atomic_test_sources}" HAVE_STDATOMIC_WITH_LIB) set(CMAKE_REQUIRED_LIBRARIES "${_req_libraries}") -- 2.35.1