From becb3ffccdecff83047285ebea20e5b85b2d65b1 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 9 Jan 2024 16:21:53 -0800 Subject: [PATCH] Fix threads detection for CROS_EC/CROS_ZEPHYR The CROS_EC and CROS_ZEPHYR platforms currently have threads disabled, so we should not attempt to search for (or link) a threads library. BUG=b/273639386 Change-Id: I094a989680160f9ecefbdb4cb3e94c4825a651e3 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/65568 Reviewed-by: David Benjamin Reviewed-by: Bob Beck Commit-Queue: Bob Beck --- crypto/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 6dd5f23f9..94327cc63 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -342,7 +342,11 @@ if(WIN32) target_link_libraries(crypto ws2_32) endif() -if(NOT ANDROID) +# CMAKE_SYSTEM_NAME is "Generic" for embedded OSes: +# https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html#toolchain-files +# +# For now we assume embedded OSes do not have threads. +if(NOT (ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "Generic")) find_package(Threads REQUIRED) target_link_libraries(crypto Threads::Threads) endif()