taka-no-me / android-cmake

CMake toolchain file and other scripts for the Android NDK
1.22k stars 438 forks source link

cmake 3.6.0 not compatible with android-cmake with Ninja on Windows #94

Closed ned14 closed 8 years ago

ned14 commented 8 years ago

Getting the following when trying to use android-cmake with cmake 3.6.0 and ninja on Windows:

RUNNING: cmake --version
cmake version 3.6.0

CMake suite maintained and supported by Kitware (kitware.com/cmake).
RUNNING: cmake -DCMAKE_TOOLCHAIN_FILE=cmake/android/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 -DTREAT_WARNINGS_AS_ERRORS=1 -G Ninja G:\Hp3d-HR-dev
CMake Deprecation Warning at G:/Program Files/CMake/share/cmake-3.6/Modules/CMakeForceCompiler.cmake:79 (message):
  The CMAKE_FORCE_C_COMPILER macro is deprecated.  Instead just set
  CMAKE_C_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  cmake/android/android.toolchain.cmake:1129 (CMAKE_FORCE_C_COMPILER)
  G:/Program Files/CMake/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:4 (PROJECT)

CMake Deprecation Warning at G:/Program Files/CMake/share/cmake-3.6/Modules/CMakeForceCompiler.cmake:93 (message):
  The CMAKE_FORCE_CXX_COMPILER macro is deprecated.  Instead just set
  CMAKE_CXX_COMPILER and allow CMake to identify the compiler.
Call Stack (most recent call first):
  cmake/android/android.toolchain.cmake:1141 (CMAKE_FORCE_CXX_COMPILER)
  G:/Program Files/CMake/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:4 (PROJECT)

CMake Error at cmake/android/android.toolchain.cmake:1622 (enable_language):
  Language 'C' is currently being enabled.  Recursive call not allowed.
Call Stack (most recent call first):
  G:/Program Files/CMake/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:4 (PROJECT)

-- Configuring incomplete, errors occurred!
Traceback (most recent call last):
  File "buildLib\build.py", line 708, in <module>
  File "buildLib\build.py", line 95, in Main
  File "buildLib\build.py", line 205, in RunCMake
  File "G:\Hp3d-HR-dev\scripts\buildLib\cmd.py", line 28, in Run
    raise(RuntimeError('ERROR (%i) running command: %s' % (ret, cmdLine)))
RuntimeError: ERROR (1) running command: cmake -DCMAKE_TOOLCHAIN_FILE=cmake/android/android.toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_TOOLCHAIN_NAME=arm-linux-androideabi-4.9 -DTREAT_WARNINGS_AS_ERRORS=1 -G Ninja G:\Hp3d-HR-dev

BUILD STEP FAILED: Running CMake
misery commented 8 years ago

Maybe you mean #71?

ned14 commented 8 years ago

The warnings about CMAKE_FORCE_CXX_COMPILER are covered by #71.

This bug refers to the fatal showstopping error at:

CMake Error at cmake/android/android.toolchain.cmake:1622 (enable_language):
  Language 'C' is currently being enabled.  Recursive call not allowed.
Call Stack (most recent call first):
  G:/Program Files/CMake/share/cmake-3.6/Modules/CMakeDetermineSystem.cmake:98 (include)
  CMakeLists.txt:4 (PROJECT)
misery commented 8 years ago

Does it happen if you remove "enable_language"?

See: https://github.com/bingmann/android-cmake/commit/e0ec7de86d454894b3837a62b8676635b6d318f6

ned14 commented 8 years ago

I went ahead and applied that entire patchset. All warnings gone, ninja + Android on Windows now works. Thanks!