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 3, 2023
1 parent 17f81fb commit 843083c
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 @@ -32,6 +32,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 @@ -89,6 +92,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 843083c

Please sign in to comment.