From: Deal(一线灵) Date: Wed, 17 May 2023 17:21:48 +0000 (+0800) Subject: cmake: repair cross compiling X-Git-Tag: curl-8_1_1~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=446061e6cb4b0e9515df61cc9d382be410285e13;p=thirdparty%2Fcurl.git cmake: repair cross compiling It cannot *run* code for testing purposes when cross-compiling. Closes #11130 --- 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)