From 1c5cee0e6537a4ed097c37f12805532b26ad45d5 Mon Sep 17 00:00:00 2001 From: daquexian Date: Tue, 19 Nov 2019 15:35:06 +0800 Subject: [PATCH] Relax the cmake version for android ndk --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 63b9149..baeb9b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,12 @@ option(DNN_BUILD_PYTHON "Build Python wrapper for onnx2daq" ON) option(DNN_USE_MSVC_STATIC_RUNTIME "Link onnx2daq to msvc static runtime" ON) option(DNN_CMAKE_INSTALL "Export targets in cmake (disable it for ONNXRuntime)" ON) +if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Android") + if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0" AND CMAKE_VERSION VERSION_LESS "3.15.2") + message(FATAL_ERROR "Android NDK is not compatible with CMake 3.15.0 and 3.15.1 (https://gitlab.kitware.com/cmake/cmake/issues/19515), please install another cmake version.") + endif() +endif() + include(cmake/system.cmake) include(cmake/common.cmake) @@ -22,9 +28,6 @@ include(cmake/flatbuffers.cmake) configure_flatbuffers() if (${CMAKE_SYSTEM_NAME} STREQUAL "Android") - if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15" AND CMAKE_VERSION VERSION_LESS "3.16") - message(FATAL_ERROR "Android NDK is not compatible with CMake 3.15 (https://gitlab.kitware.com/cmake/cmake/issues/19515), please install another cmake version.") - endif() add_compile_options(-Os) set (CMAKE_CXX_STANDARD 17) if (${DNN_READ_ONNX})