diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/mbedtls/vcpkg-cmake-wrapper.cmake | |
Diffstat (limited to 'vcpkg/ports/mbedtls/vcpkg-cmake-wrapper.cmake')
| -rw-r--r-- | vcpkg/ports/mbedtls/vcpkg-cmake-wrapper.cmake | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vcpkg/ports/mbedtls/vcpkg-cmake-wrapper.cmake b/vcpkg/ports/mbedtls/vcpkg-cmake-wrapper.cmake new file mode 100644 index 0000000..9d9be2f --- /dev/null +++ b/vcpkg/ports/mbedtls/vcpkg-cmake-wrapper.cmake @@ -0,0 +1,23 @@ +_find_package(${ARGS}) +if(WIN32 AND NOT MINGW) + find_package(PThreads4W) + string(FIND "${MBEDTLS_CRYPTO_LIBRARY}" "${PThreads4W_LIBRARY}" pthreads_in_mbedtls) + if(pthreads_in_mbedtls EQUAL "-1") + list(APPEND MBEDTLS_CRYPTO_LIBRARY ${PThreads4W_LIBRARY}) + endif() + string(FIND "${MBEDTLS_LIBRARIES}" "${PThreads4W_LIBRARY}" pthreads_in_mbedtls) + if(pthreads_in_mbedtls EQUAL "-1") + list(APPEND MBEDTLS_LIBRARIES ${PThreads4W_LIBRARY}) + endif() +else() + set(THREADS_PREFER_PTHREAD_FLAG 1) + find_package(Threads) + string(FIND "${MBEDTLS_CRYPTO_LIBRARY}" "${CMAKE_THREAD_LIBS_INIT}" pthreads_in_mbedtls) + if(pthreads_in_mbedtls EQUAL "-1") + list(APPEND MBEDTLS_CRYPTO_LIBRARY ${CMAKE_THREAD_LIBS_INIT}) + endif() + string(FIND "${MBEDTLS_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}" pthreads_in_mbedtls) + if(pthreads_in_mbedtls EQUAL "-1") + list(APPEND MBEDTLS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) + endif() +endif() |