From 462b3a491347e452c15220861949b1d6371fa59e Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 21 Sep 2021 19:41:09 +0200 Subject: [PATCH] build: use pthread cflags/ldflags Fixes build on glibc Signed-off-by: Felix Fietkau --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb96cab..dd5ad4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,10 +2,13 @@ cmake_minimum_required(VERSION 3.12) PROJECT(ustp C) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads) + ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations -Wno-error=missing-declarations -I${CMAKE_SOURCE_DIR}) ADD_EXECUTABLE(ustpd bridge_track.c brmon.c hmac_md5.c libnetlink.c mstp.c netif_utils.c packet.c worker.c config.c main.c ubus.c) -TARGET_LINK_LIBRARIES(ustpd ubox ubus) +TARGET_LINK_LIBRARIES(ustpd ubox ubus Threads::Threads) SET(CMAKE_INSTALL_PREFIX /) -- 2.30.2