From 6439b2550014fd2db2ad15bda8f3569db31994d2 Mon Sep 17 00:00:00 2001 From: dxl <64101226@qq.com> Date: Fri, 17 Jan 2025 12:44:04 +0800 Subject: [PATCH] Fix the issue where compiling on Linux does not link to the pthread library. --- software/src/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/software/src/CMakeLists.txt b/software/src/CMakeLists.txt index bb8d2eb..7f64487 100644 --- a/software/src/CMakeLists.txt +++ b/software/src/CMakeLists.txt @@ -35,7 +35,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") add_compile_options(-D_GNU_SOURCE) - find_package(Threads) + find_package(Threads REQUIRED) + set(LIBTHREAD pthread) elseif (CMAKE_SYSTEM_NAME MATCHES "Windows") MESSAGE(STATUS "Run on Windows.")