Home > Back-end >  Under the Windows with CMake cross-compilation Android when static library CMAKE_SYSTEM_NAME is'
Under the Windows with CMake cross-compilation Android when static library CMAKE_SYSTEM_NAME is'

Time:01-07

Everyone passing by the great spirit, I under the Windows with CMake cross-compilation Android Native static library and dynamic library, to the following error:
CMAKE_SYSTEM_NAME is' Android 'but' NVIDIA Nsight prototypes Visual Studio
Edition 'is not installed.

My Cmake command and parameters is as follows:
Cmake - DANDROID_NATIVE_API_LEVEL=16 \
- DCMAKE_SYSTEM_VERSION=21 \
- DCMAKE_TOOLCHAIN_FILE=E://android SDK - the NDK - r13 - Windows - x86_64/android - cmake - master/android. The toolchain. Cmake \
- DANDROID_NDK=E://android SDK - the NDK - r13 - Windows - x86_64/android - the NDK - r13 \
- DCMAKE_BUILD_TYPE=Release \
- DANDROID_ABI="armeabi - v7a \
"- DANDROID_PLATFORM=android - 21 \
- DANDROID_ARM_NEON=TRUE
Cmake -- build.

The problem of searching the whole network, also saw the Cmake website, have several days, always can't find a solution, since this to seek the aid of everyone a great god, the great god, how can I solve this problem? ,,,,,,,,

CodePudding user response:

Baidu search relevant keywords,

CodePudding user response:

.

CodePudding user response:

Myself to answer. On Windows, if you don't specify the corresponding "compiler", then it will default to VS, libraries, and compile VS Android platform will use a NVIDIA Nsight prototypes Visual Studio Edition, because I have not used VS, on my computer did not install the NVIDIA thing, even if installed, also will still be wrong. Careful lu friends will find that, under the AS Google's dad is a Ninja, AS to what is this? I can only tell you I don't know, Google is very diao anyway. The ninja can be downloaded through the Android SDK manager when CMake, downloaded to a local configured environment variables, you can use the ninja to compile. Finally, cross-compilation script:
set toolchain=E:/Android/the NDK/Android - the NDK - r13b - Windows - x86_64/Android - the NDK - r13b/build/cmake/Android. The toolchain. Cmake
The set android_ndk=E:/Android/the NDK/Android - the NDK - r13b - Windows - x86_64/Android - the NDK - r13b
The set build_type=Release
The set gernerator="Ninja"
If not exist % 1 md % 1
CD % 1
Cmake../.. - a toolchain DCMAKE_TOOLCHAIN_FILE=% % - DANDROID_NDK build_type - DCMAKE_BUILD_TYPE=android_ndk=% % % % - DANDROID_ABI="% 1" - DCMAKE_GENERATOR gernerator=% %
Ninja

% 1 is the incoming parameters, that is, the name of the corresponding architecture. Wait not busy, I put my grope for the process of sorting out.

CodePudding user response:

If lu friends have encountered this problem, you can [email protected] I discuss a better solution.

CodePudding user response:

Under the WSL
/MNT/c/Windows/System32/CMD. Exe/c cmake - DCMAKE_TOOLCHAIN_FILE=$$CMAKE_OPTIONS LOCAL_CMAKE_TOOLCHAIN_FILE - DCMAKE_GENERATOR="Unix Makefiles" - DCMAKE_MAKE_PROGRAM="make. Exe".
Windows CMD, can not in front of the CMD. Exe/C
Need to make the NDK directory. Exe to join the Windows system environment variables
  • Related