From 27012dc4a42bae1b16ea1dacefb2ebc1d9b4402f Mon Sep 17 00:00:00 2001 From: nekosu Date: Wed, 10 Sep 2025 19:29:08 +0800 Subject: [PATCH] fix: pthread linking problem # 14045 --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c4a6a53aa..7b1d3c0cad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ target_link_libraries(MaaCore HeaderOnlyLibraries ${OpenCV_LIBS} fastdeploy_ppoc if(WIN32) target_link_libraries(MaaCore ws2_32) endif() +if(LINUX) + target_link_libraries(MaaCore pthread) +endif() source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${maa_src}) @@ -104,9 +107,6 @@ if (BUILD_DEBUG_DEMO) target_compile_options(debug_demo PRIVATE "-Wno-error") endif() target_link_libraries(debug_demo MaaCore) - if(LINUX) - target_link_libraries(debug_demo pthread) - endif() add_dependencies(debug_demo MaaCore) # install(TARGETS debug_demo ${MaaCore_install_flatten_args})