From 446061e6cb4b0e9515df61cc9d382be410285e13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Deal=28=E4=B8=80=E7=BA=BF=E7=81=B5=29?= Date: Thu, 18 May 2023 01:21:48 +0800 Subject: [PATCH] cmake: repair cross compiling It cannot *run* code for testing purposes when cross-compiling. Closes #11130 --- lib/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 51512045d2..845d1e319d 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -131,8 +131,8 @@ if(WIN32) set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib") endif() endif() -else() - # on not-Windows, check for writable argv[] +elseif(NOT CMAKE_CROSSCOMPILING) + # on not-Windows and not-crosscompiling, check for writable argv[] include(CheckCSourceRuns) check_c_source_runs(" int main(int argc, char **argv) -- 2.47.3