]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: repair cross compiling
authorDeal(一线灵) <halx99@live.com>
Wed, 17 May 2023 17:21:48 +0000 (01:21 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 18 May 2023 19:13:12 +0000 (21:13 +0200)
It cannot *run* code for testing purposes when cross-compiling.

Closes #11130

lib/CMakeLists.txt

index 51512045d2620112ec5848414963969ee95f1f74..845d1e319dd0efd793f694709973476a17edca1f 100644 (file)
@@ -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)