summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2021-09-21 17:41:09 +0000
committerFelix Fietkau2021-09-21 17:41:11 +0000
commit462b3a491347e452c15220861949b1d6371fa59e (patch)
tree49294aaf8b623a79cc6b8572fb4d01c7dfa8df69
parent25555611be916da7fe8cb53f85c741a51ddffa1c (diff)
downloadustp-462b3a491347e452c15220861949b1d6371fa59e.tar.gz
build: use pthread cflags/ldflags
Fixes build on glibc Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--CMakeLists.txt5
1 files changed, 4 insertions, 1 deletions
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 /)