nmeum / android-tools

Unoffical CMake-based build system for android command line utilities
Apache License 2.0
177 stars 51 forks source link

build failure on archlinux , gcc 12 #70

Closed ahmedmoselhi closed 2 years ago

ahmedmoselhi commented 2 years ago
In file included from /home/ahmed/android-tools/vendor/adb/client/auth.cpp:35:
/home/ahmed/android-tools/vendor/adb/tls/include/adb/tls/tls_connection.h:51:31: error: ‘function’ in namespace ‘std’ does not name a template type
   51 |     using CertVerifyCb = std::function<int(X509_STORE_CTX*)>;
      |                               ^~~~~~~~
/home/ahmed/android-tools/vendor/adb/tls/include/adb/tls/tls_connection.h:27:1: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
   26 | #include <openssl/ssl.h>
  +++ |+#include <functional>
   27 | #include <openssl/x509.h>
/home/ahmed/android-tools/vendor/adb/tls/include/adb/tls/tls_connection.h:52:28: error: ‘function’ in namespace ‘std’ does not name a template type
   52 |     using SetCertCb = std::function<int(SSL*)>;
      |                            ^~~~~~~~
/home/ahmed/android-tools/vendor/adb/tls/include/adb/tls/tls_connection.h:52:23: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
   52 |     using SetCertCb = std::function<int(SSL*)>;
      |                       ^~~
/home/ahmed/android-tools/vendor/adb/tls/include/adb/tls/tls_connection.h:67:40: error: ‘CertVerifyCb’ has not been declared
   67 |     virtual void SetCertVerifyCallback(CertVerifyCb cb) = 0;
      |                                        ^~~~~~~~~~~~
/home/ahmed/android-tools/vendor/adb/tls/include/adb/tls/tls_connection.h:76:41: error: ‘SetCertCb’ has not been declared
   76 |     virtual void SetCertificateCallback(SetCertCb cb) = 0;
      |                                         ^~~~~~~~~
/home/ahmed/android-tools/vendor/adb/client/auth.cpp: In function ‘bool load_keys(const std::string&, bool)’:
/home/ahmed/android-tools/vendor/adb/client/auth.cpp:178:49: warning: ignoring attributes on template argument ‘int (*)(DIR*)’ [-Wignored-attributes]
  178 |         std::unique_ptr<DIR, decltype(&closedir)> dir(opendir(path.c_str()), closedir);
      |                                                 ^
make[2]: *** [vendor/CMakeFiles/libadb.dir/build.make:150: vendor/CMakeFiles/libadb.dir/adb/client/auth.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:456: vendor/CMakeFiles/libadb.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

i'm using latest tarballs 31.0.3

nmeum commented 2 years ago

This has been fixed on the master (see #61), however, unfortunately I haven't had the time to make a new patch release yet. Will hopefully get around to doing that this weekend.

nmeum commented 2 years ago

I created a new release in https://github.com/nmeum/android-tools/releases/tag/31.0.3p2 which passes on our Arch Linux CI with both GCC and Clang. Let me know if you encounter any issues.