Skip to content

Commit

Permalink
cmake: Add pthread dependendency
Browse files Browse the repository at this point in the history
When using some older compilers, the missing pthread dependency
results in build errors.
  • Loading branch information
harishdm committed Oct 2, 2023
1 parent 6a08111 commit 5bcd165
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ set(CMAKE_CXX_STANDARD 17)

include(ExternalProject)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# Check the target architecture and set compiler flags accordingly
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
# 64-bit architecture
Expand Down Expand Up @@ -79,6 +82,7 @@ target_include_directories(ultrahdr PRIVATE
target_link_libraries(ultrahdr PRIVATE
${SRC_DIR}/third_party/build/libjpeg-turbo/src/libjpeg-turbo-build/libjpeg.a
image_io
Threads::Threads
)

libultrahdr_add_executable(ultrahdr_unit_test
Expand Down

0 comments on commit 5bcd165

Please sign in to comment.