From 336319966b484889bbdd1da58623293b93980628 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Sun, 1 Dec 2019 00:51:16 +0100 Subject: [PATCH] Fixed cmake 3.16.0 incompatibility. --- cmake/configure/configure_1_threads.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake/configure/configure_1_threads.cmake b/cmake/configure/configure_1_threads.cmake index b4de2cc2cc..b039497a13 100644 --- a/cmake/configure/configure_1_threads.cmake +++ b/cmake/configure/configure_1_threads.cmake @@ -38,6 +38,16 @@ MACRO(SETUP_THREADING) RESET_CMAKE_REQUIRED() + # + # The FindThreads macro returned a linker option instead of the actual + # library name in earlier versions. We still require the linker option, + # so we fix the corresponding variable. + # - See: https://gitlab.kitware.com/cmake/cmake/issues/19747 + # + IF(CMAKE_THREAD_LIBS_INIT AND NOT "${CMAKE_THREAD_LIBS_INIT}" MATCHES "^-l") + STRING(PREPEND CMAKE_THREAD_LIBS_INIT "-l") + ENDIF() + ELSE() # -- 2.39.5