diff options
author | David Benjamin <davidben@google.com> | 2024-01-23 15:22:45 -0500 |
---|---|---|
committer | Boringssl LUCI CQ <boringssl-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2024-01-26 18:55:00 +0000 |
commit | 8378dad8af30bc825518ef38098c4a50cfa99728 (patch) | |
tree | 2863a153acd7818b85e0b223c5899964c875b873 | |
parent | 4a8653a48685748b795db51d40e80088ad86dd2a (diff) | |
download | boringssl-8378dad8af30bc825518ef38098c4a50cfa99728.zip boringssl-8378dad8af30bc825518ef38098c4a50cfa99728.tar.gz boringssl-8378dad8af30bc825518ef38098c4a50cfa99728.tar.bz2 |
Remove remnants of the old Android CMake toolchain
The PATH-related workarounds for the old third-party Android toolchain
don't seem to apply to the official NDK one, so just remove them. The
official one does define the ANDROID variable, but only in an
"android-legacy.toolchain.cmake". I think the standard way to do this is
CMAKE_SYSTEM_NAME so switch to that.
Change-Id: I3f3fa69d482893c333ae06f54ac39434c3c6a56c
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/65670
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
-rw-r--r-- | CMakeLists.txt | 10 | ||||
-rw-r--r-- | cmake/go.cmake | 11 | ||||
-rw-r--r-- | crypto/CMakeLists.txt | 6 | ||||
-rw-r--r-- | util/generate_build_files.py | 2 |
4 files changed, 7 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c7926d..0639217 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,15 +43,7 @@ function(install_if_enabled) endif() endfunction() -if(ANDROID) - # Android-NDK CMake files reconfigure the path and so Perl won't be found. - # However, ninja will still find them in $PATH if we just name them. - if(NOT PERL_EXECUTABLE) - set(PERL_EXECUTABLE "perl") - endif() -else() - find_package(Perl REQUIRED) -endif() +find_package(Perl REQUIRED) if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT CMAKE_CROSSCOMPILING) find_package(PkgConfig QUIET) diff --git a/cmake/go.cmake b/cmake/go.cmake index 966ad32..51ecb45 100644 --- a/cmake/go.cmake +++ b/cmake/go.cmake @@ -1,13 +1,4 @@ -if(ANDROID) - # Android-NDK CMake files reconfigure the path and so Go won't be found. - # However, ninja will still find them in $PATH if we just name them. - if(NOT GO_EXECUTABLE) - set(GO_EXECUTABLE "go") - endif() -else() - find_program(GO_EXECUTABLE go) -endif() - +find_program(GO_EXECUTABLE go) if(NOT GO_EXECUTABLE) message(FATAL_ERROR "Could not find Go") endif() diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index 94327cc..3263e9e 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt @@ -345,8 +345,10 @@ endif() # 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")) +# For now we assume embedded OSes do not have threads. Additionally, the Threads +# package does not work with Android, but Android does not require any extra +# parameters to link pthreads. +if(NOT CMAKE_SYSTEM_NAME MATCHES "^(Generic|Android)$") find_package(Threads REQUIRED) target_link_libraries(crypto Threads::Threads) endif() diff --git a/util/generate_build_files.py b/util/generate_build_files.py index 864febf..41d5a50 100644 --- a/util/generate_build_files.py +++ b/util/generate_build_files.py @@ -547,7 +547,7 @@ endif() self.PrintExe(cmake, 'bssl', files['tool'], ['ssl', 'crypto']) cmake.write( -R'''if(NOT ANDROID) +R'''if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android") find_package(Threads REQUIRED) target_link_libraries(crypto Threads::Threads) endif() |