1

全部。我正在尝试使用 cmake 在 Windows 7x64 上使用 android 工具链编译一些 android 代码。

当我按以下方式调用cmake时 cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=android.cmake 1>!cmake.log 2>!cmake.error.log

我从管理员控制台运行此命令并获得以下输出:

!cmake.log

-- The C compiler identification is GNU 4.6.0
-- The CXX compiler identification is GNU 4.6.0
-- Check for working C compiler: c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe
-- Check for working C compiler: c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe -- broken
-- Configuring incomplete, errors occurred!

!cmake.error.log

CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
The C compiler
  "c:/cygwin/usr/local/android-toolchain-r8ea9/bin/arm-linux-androideabi-gcc.exe"
  is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/PDK_BUILD/openssl/CMakeFiles/CMakeTmp



  Run Build Command:C:/PROGRA~2/CMAKE2~1.8/bin/cmake.exe
  "cmTryCompileExec333575975/fast"

  CMake Error: The source directory
  "C:/PDK_BUILD/openssl/CMakeFiles/CMakeTmp/cmTryCompileExec333575975/fast"
  does not exist.


  Specify --help for usage, or press the help button on the CMake GUI.






  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):

我授予 cmake.exe 本身的管理员权限,从文件夹中清除只读属性CMakeFiles并禁用防病毒,但仍然无法正常工作。

4

1 回答 1

1

看起来您遇到了CMake Bug 0013131该评论表明使用unset TMP应该可以解决问题。在重试之前,不要忘记删除CMakeCache.txtandCMakeFiles文件夹(或使用外源构建时的整个构建树)。

于 2015-09-18T08:56:09.183 回答