From 18dab0ee4f0bfc4d3247ca640cc3943f4d0528c6 Mon Sep 17 00:00:00 2001 From: Zhuo Zhang Date: Sat, 5 Dec 2020 17:22:55 +0800 Subject: [PATCH] don't compile tools and examples when crosscompile (#2389) When cross-compiling, such as arm-linux-gnueabihf, x86 OpenCV may be wrongly found by tools & examples targets. Turn tools and examples off when cross compiling. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 394abc324..85ea64b71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,7 @@ option(NCNN_BUILD_TESTS "build tests" OFF) option(NCNN_COVERAGE "build for coverage" OFF) option(NCNN_BUILD_BENCHMARK "build benchmark" ON) -if(ANDROID OR IOS OR NCNN_SIMPLESTL) +if(ANDROID OR IOS OR NCNN_SIMPLESTL OR CMAKE_CROSSCOMPILING) option(NCNN_DISABLE_RTTI "disable rtti" ON) option(NCNN_BUILD_TOOLS "build tools" OFF) option(NCNN_BUILD_EXAMPLES "build examples" OFF)