Find threading library

CMake has FindThreads to determine how to link the threading library. Use that over just setting pthread in the link libraries and add support for Windows threads.

Change-Id: I5988c54db6a9db688b7d990fc3808d3ae5f2b66f
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/54146
Reviewed-by: David Benjamin <davidben@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
chromium-5359
Don 2 years ago committed by Boringssl LUCI CQ
parent 4ff604e98f
commit 8a3b2692bc
  1. 5
      crypto/CMakeLists.txt

@ -465,8 +465,9 @@ endif()
SET_TARGET_PROPERTIES(crypto PROPERTIES LINKER_LANGUAGE C)
if(NOT WIN32 AND NOT ANDROID)
target_link_libraries(crypto pthread)
if(NOT ANDROID)
find_package(Threads REQUIRED)
target_link_libraries(crypto Threads::Threads)
endif()
# Every target depends on crypto, so we add libcxx as a dependency here to

Loading…
Cancel
Save