cmake: repair cross compiling

It cannot *run* code for testing purposes when cross-compiling.

Closes #11130
This commit is contained in:
Deal(一线灵) 2023-05-18 01:21:48 +08:00 committed by Daniel Stenberg
parent b78ca50cb3
commit 446061e6cb
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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)