'cmake' generates build.ninja such that it looks in /usr/local/include before locations in the working build tree. If the openssl port is installed, then the build finds those files before the bundled ssl (boringssl). This triggers a build failure: FAILED: vendor/CMakeFiles/libadb_tls_connection_defaults.dir/adb/tls/tls_connection.cpp.o /usr/bin/c++ -I/usr/local/include -I/wrkdirs/usr/ports/devel/android-tools/work/.build/vendor -I/wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb -I/wrkdirs/usr/ports/devel/android-tools/work/freebsd -android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/include -I/wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/boringssl/include -I/wrkdirs/usr/ports/devel/android-tools/work/freebsd-a ndroid-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/libbase/include -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -std=gnu++2a -Wno-attributes -D_FILE_OFFSET_BITS=64 -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -MD -MT vendor/CMakeFiles/l ibadb_tls_connection_defaults.dir/adb/tls/tls_connection.cpp.o -MF vendor/CMakeFiles/libadb_tls_connection_defaults.dir/adb/tls/tls_connection.cpp.o.d -o vendor/CMakeFiles/libadb_tls_connection_defaults.dir/adb/tls/tls_connection.cpp.o -c /wrkdirs/usr/ports/devel/andr oid-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp /wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp:55:12: error: use of undeclared identifier 'bssl' static bssl::UniquePtr<EVP_PKEY> EvpPkeyFromPEM(std::string_view pem); ^ /wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp:56:12: error: use of undeclared identifier 'bssl' static bssl::UniquePtr<CRYPTO_BUFFER> BufferFromPEM(std::string_view pem); ^ /wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp:56:28: error: use of undeclared identifier 'CRYPTO_BUFFER' static bssl::UniquePtr<CRYPTO_BUFFER> BufferFromPEM(std::string_view pem); ^ /wrkdirs/usr/ports/devel/android-tools/work/freebsd-android-tools-7fa3613259c9c1e4bc4f82af46dfca975e28a930/vendor/adb/tls/tls_connection.cpp:62:12: error: use of undeclared identifier 'bssl' static bssl::UniquePtr<X509> X509FromBuffer(bssl::UniquePtr<CRYPTO_BUFFER> buffer); ^ . . Hacky workaround: delete the openssl package when building android-tools. Better would be to convince cmake to put -I flags for in-tree directories ahead of -I /usr/local/include. But it is not obvious how to tell cmake to put include paths that it "finds" at the end of the list of include paths. Or maybe it is obvious to someone.
Similar problem, but different: bug 264597
I have some good news: I found out how to fix it. Apparently in CMake I need to do `BEFORE SYSTEM`. Will push a patch shortly.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=52709fc2c45fe7662dc1278077d763b246c63c0e commit 52709fc2c45fe7662dc1278077d763b246c63c0e Author: Neel Chauhan <nc@FreeBSD.org> AuthorDate: 2022-06-10 23:18:56 +0000 Commit: Neel Chauhan <nc@FreeBSD.org> CommitDate: 2022-06-10 23:18:56 +0000 devel/android-tools: Updaste to 31.0.3p1r1 Changes: * Fix build when security/openssl and devel/libfmt is installed * Don't rely on /proc to resolve pathname PR: 264597, 264603 Reported by: John Hein and Martin Birgmeier (depencency), Baptiste Daroussin (Linuxism) devel/android-tools/Makefile | 4 ++-- devel/android-tools/distinfo | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)