link with threads

This commit is contained in:
Nils O. Selåsdal
2025-07-16 20:02:25 +02:00
parent 2278080b69
commit 2bd91ae751
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -15,8 +15,8 @@ set(CMAKE_C_STANDARD 99)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wcast-qual -Wshadow -Wcast-align -pipe -Wno-unused-parameter -Werror=implicit-function-declaration -Winit-self -pthread") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wundef -Wcast-qual -Wshadow -Wcast-align -pipe -Wno-unused-parameter -Werror=implicit-function-declaration -Winit-self -pthread")
add_definitions(-D_FILE_OFFSET_BITS=64) add_definitions(-D_FILE_OFFSET_BITS=64)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -O2 -pthread") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -O2 -pthread")
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
option(CODE_COVERAGE "build with code coverage intrumentation" OFF) option(CODE_COVERAGE "build with code coverage intrumentation" OFF)
if (CODE_COVERAGE) if (CODE_COVERAGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
+1 -1
View File
@@ -8,7 +8,7 @@ else()
target_link_libraries(rt) target_link_libraries(rt)
endif() endif()
add_executable(test_runner ${TEST_SOURCE_FILES}) add_executable(test_runner ${TEST_SOURCE_FILES})
target_link_libraries(test_runner check ucore) target_link_libraries(test_runner check ucore PRIVATE Threads::Threads)
add_custom_target(test COMMAND test_runner add_custom_target(test COMMAND test_runner
DEPENDS test_runner DEPENDS test_runner