Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cross compile error! android and macos #174

Closed
wfeii1980 opened this issue Dec 27, 2022 · 4 comments
Closed

Cross compile error! android and macos #174

wfeii1980 opened this issue Dec 27, 2022 · 4 comments

Comments

@wfeii1980
Copy link

wfeii1980 commented Dec 27, 2022

macos dev arm64 12.6.1 (--target x86_64-apple-darwin)
android dev Debian 11 x86_64 (--target aarch64-linux-android,armv7-linux-androideabi,i686-linux-android,x86_64-linux-android)

  1. cmake 0.1.48
    a. android successful
    b. macos aborted
  2. cmake 0.1.49
    a. android aborted
    b. macos successful

0.1.49 error info

[2022-12-27T09:06:48Z INFO  cargo_ndk::cli] Using NDK at path: /home/wii/data/android/android-ndk-r22b (ANDROID_NDK_HOME)
[2022-12-27T09:06:48Z INFO  cargo_ndk::cli] NDK API level: 21
[2022-12-27T09:06:48Z INFO  cargo_ndk::cli] Building targets: arm64-v8a
[2022-12-27T09:06:48Z INFO  cargo_ndk::cli] Building arm64-v8a (aarch64-linux-android)

---

  CMAKE_TOOLCHAIN_FILE_aarch64-linux-android = None
  CMAKE_TOOLCHAIN_FILE_aarch64_linux_android = None
  TARGET_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_aarch64-linux-android = None
  CMAKE_GENERATOR_aarch64_linux_android = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-linux-android = None
  CMAKE_PREFIX_PATH_aarch64_linux_android = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-linux-android = None
  CMAKE_aarch64_linux_android = None
  TARGET_CMAKE = None
  CMAKE = None
  running: "cmake" "/home/wii/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/datachannel-sys-0.18.0/libdatachannel" "-DNO_WEBSOCKET=ON" "-DNO_EXAMPLES=ON" "-DNO_MEDIA=ON" "-DOPENSSL_ROOT_DIR=/media/wii/disk1t/works/hlldesk-odontoceti/target/aarch64-linux-android/release/build/datachannel-sys-dc4825284f866567/out/openssl-build/install" "-DOPENSSL_USE_STATIC_LIBS=TRUE" "-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_SYSTEM_PROCESSOR=aarch64" "-DCMAKE_INSTALL_PREFIX=/media/wii/disk1t/works/hlldesk-odontoceti/target/aarch64-linux-android/release/build/datachannel-sys-dc4825284f866567/out" "-DCMAKE_C_FLAGS= -DANDROID -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_C_COMPILER=/home/wii/data/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang" "-DCMAKE_CXX_FLAGS= -DANDROID -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_CXX_COMPILER=/home/wii/data/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang++" "-DCMAKE_ASM_FLAGS= -DANDROID -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_ASM_COMPILER=/home/wii/data/android/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang" "-DCMAKE_BUILD_TYPE=MinSizeRel"
  -- Configuring incomplete, errors occurred!

  --- stderr
  ar: creating libcrypto.a
  ar: creating libssl.a
  CMake Error at /usr/share/cmake-3.18/Modules/Platform/Android-Determine.cmake:144 (message):
    Android: Neither the NDK or a standalone toolchain was found.
  Call Stack (most recent call first):
    /usr/share/cmake-3.18/Modules/CMakeDetermineSystem.cmake:129 (include)
    CMakeLists.txt:2 (project)


  CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /home/wii/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/cmake-0.1.49/src/lib.rs:1104:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@wfeii1980
Copy link
Author

Related to newly added parameters
"-DCMAKE_SYSTEM_NAME=Android" "-DCMAKE_SYSTEM_PROCESSOR=aarch64"

@wfeii1980
Copy link
Author

wfeii1980 commented Dec 27, 2022

Recurrence method

git clone https://github.com/lerouxrgd/datachannel-rs
sed -i 's/cmake = "0.1"/cmake = "0.1.49"/g' datachannel-sys/Cargo.toml
ANDROID_NDK_HOME=~/android-ndk-r22b cargo ndk --platform 21 --target aarch64-linux-android build

@HuixingWong
Copy link

Any update ?

@tgross35
Copy link
Contributor

#186 and #209 updated the SYSTEM_NAME and SYSTEM_PROCESSOR config for these targets. These changes are in 0.1.51.

I'll close this assuming the problem is fixed, but please open a new issue if that doesn't seem to be the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants