Error: vendor/CMakeFiles/libadb.dir/build.make:73: *** target pattern contains no '%'. Stop.
Jacky323 opened this issue · 13 comments
Could you try the latest version 34.0.0? Is it possible to reproduce the issue in Linux distribution other than any Debian family?
@Biswa96 hi, I can compile android-tools 29.0.6, but doesn't work well with android-tools 30.0.5.
can you tell me what version of cmake and gcc on your os?
can you tell me what version of cmake and gcc on your os?
gcc 12.2.1 clang 15.0.7 cmake 3.26.3
I can compile android-tools 29.0.6, but doesn't work well with android-tools 30.0.5.
May I ask why you are compiling old releases? The old releases can not be compiled with the latest toolchain in my system due to many compiler error. But your issue seems to be in the generated make files.
Issue can not be reproduced.
I was able to reproduce the issue where, if the protobuf-compiler
Debian package (which provides /usr/bin/protoc) is not installed, the line in android-tools/build/vendor/CMakeFiles/libadb.dir/build.make
appears as:
vendor/app_processes.pb.h: vendor/protobuf::protoc
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --blue --bold --progress-dir=....
However, after installing the package, the line changes to:
vendor/app_processes.pb.h: /usr/bin/protoc
@$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --blue --bold --progress-dir=....
So, installing the protobuf-compiler package resolves the issue.
the line in android-tools/build/vendor/CMakeFiles/libadb.dir/build.make appears as
That file is not from this repository. Debian has different build mechanism.
I understand, but this file is generated after running cmake -B build
in repository dir
Could we add a check for protoc
after this line in CMakeLists.txt, like this?
if(NOT Protobuf_PROTOC_EXECUTABLE)
message(FATAL_ERROR "Protobuf_PROTOC_EXECUTABLE is not set.")
endif()
I can see the necessity for adding that check. find_package(Protobuf REQUIRED)
should already fail if protobuf is absent.
SnowNF@localhost:~/android-tools-35.0.1/build$ rm -r *
SnowNF@localhost:~/android-tools-35.0.1/build$ sudo apt install libprotobuf-dev
libprotobuf-dev is already the newest version (3.21.12-9).
Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 1262
SnowNF@localhost:~/android-tools-35.0.1/build$ protoc
Command 'protoc' not found, but can be installed with:
sudo apt install protobuf-compiler
SnowNF@localhost:~/android-tools-35.0.1/build$ cmake --version
cmake version 3.30.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
SnowNF@localhost:~/android-tools-35.0.1/build$ cmake ..
-- The C compiler identification is GNU 13.2.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_SUPPORTS_TRIVIAL_ZERO_INIT
-- Performing Test COMPILER_SUPPORTS_TRIVIAL_ZERO_INIT - Success
-- Found Perl: /usr/bin/perl (found version "5.38.2")
-- Checking for module 'libunwind-generic>=1.3.0'
-- Found libunwind-generic, version 1.6.2
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Version: 10.2.0
-- Build type:
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
-- Checking for module 'libbrotlicommon'
-- Found libbrotlicommon, version 1.1.0
-- Checking for module 'libbrotlidec'
-- Found libbrotlidec, version 1.1.0
-- Checking for module 'libbrotlienc'
-- Found libbrotlienc, version 1.1.0
-- Checking for module 'liblz4'
-- Found liblz4, version 1.9.4
-- Checking for module 'libpcre2-8'
-- Found libpcre2-8, version 10.42
-- Checking for module 'libusb-1.0'
-- Found libusb-1.0, version 1.0.27
-- Checking for module 'libzstd'
-- Found libzstd, version 1.5.5
-- Could NOT find Protobuf (missing: Protobuf_DIR)
-- Found Protobuf: /usr/lib/aarch64-linux-gnu/libprotobuf.so (found version "3.21.12")
-- Looking for strlcpy
-- Looking for strlcpy - found
-- Looking for reallocarray
-- Looking for reallocarray - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Configuring done (3.4s)
-- Generating done (0.3s)
-- Build files have been written to: /home/SnowNF/android-tools-35.0.1/build
That looks like a valid reason to me but I am not sure if Protobuf_PROTOC_EXECUTABLE
variable is valid for all supported protobuf versions.