Merge pull request #3210 from NikitaFeodonit/main

CMake: Detect pthread with module FindThread
This commit is contained in:
Khaled Hosny 2021-09-17 11:25:42 +02:00 committed by GitHub
commit 60a38d7988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.0) cmake_minimum_required(VERSION 3.1)
project(harfbuzz) project(harfbuzz)
message(WARN "HarfBuzz has a Meson port and tries to migrate all the other build systems to it, please consider using it as we might remove our cmake port soon.") message(WARN "HarfBuzz has a Meson port and tries to migrate all the other build systems to it, please consider using it as we might remove our cmake port soon.")
@ -102,9 +102,13 @@ if (${HAVE_STDBOOL_H})
add_definitions(-DHAVE_STDBOOL_H) add_definitions(-DHAVE_STDBOOL_H)
endif () endif ()
# https://github.com/harfbuzz/harfbuzz/pull/2874#issuecomment-782859099 if (NOT MSVC)
if (NOT WIN32) set(THREADS_PREFER_PTHREAD_FLAG ON)
add_definitions("-DHAVE_PTHREAD") find_package(Threads)
if (CMAKE_USE_PTHREADS_INIT)
add_definitions("-DHAVE_PTHREAD")
list(APPEND THIRD_PARTY_LIBS Threads::Threads)
endif ()
endif () endif ()
if (MSVC) if (MSVC)