From b31ac86a27e058c3b1c6d9cf0cf9f25d9ce9ce4f Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Thu, 18 Aug 2022 14:37:55 +0800 Subject: [PATCH] cmake: add check for util lib --- CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 919c983..ae540d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,8 +82,11 @@ if(WIN32) list(APPEND LINK_LIBS shell32 ws2_32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/app.rc.in ${CMAKE_CURRENT_BINARY_DIR}/app.rc @ONLY) list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/app.rc) -elseif(NOT APPLE) - list(APPEND LINK_LIBS util) +else() + find_library(LIBUTIL NAMES util) + if(LIBUTIL) + list(APPEND LINK_LIBS util) + endif() endif() add_executable(${PROJECT_NAME} ${SOURCE_FILES}) -- 2.43.4