summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-05-30 13:38:38 (GMT)
committerBrad King <brad.king@kitware.com>2023-05-30 13:39:43 (GMT)
commita6c9b53273eb3ef8b4d9a0a2a0fc6a4822211b9d (patch)
tree23bfdb5c7a2254a82571a4acb78b5a25c1641898 /Utilities/cmcurl/lib/CMakeLists.txt
parent7f1abf62e12a261a2fc91a2d527b5c4a30e25d41 (diff)
parent80cb6a512119ea6f8f8cf480c78e1e32d494e6ca (diff)
downloadCMake-a6c9b53273eb3ef8b4d9a0a2a0fc6a4822211b9d.zip
CMake-a6c9b53273eb3ef8b4d9a0a2a0fc6a4822211b9d.tar.gz
CMake-a6c9b53273eb3ef8b4d9a0a2a0fc6a4822211b9d.tar.bz2
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2023-05-30 (7ab9d437)
Diffstat (limited to 'Utilities/cmcurl/lib/CMakeLists.txt')
-rw-r--r--Utilities/cmcurl/lib/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Utilities/cmcurl/lib/CMakeLists.txt b/Utilities/cmcurl/lib/CMakeLists.txt
index c3eb842..f1d0f76 100644
--- a/Utilities/cmcurl/lib/CMakeLists.txt
+++ b/Utilities/cmcurl/lib/CMakeLists.txt
@@ -114,6 +114,7 @@ if(0) # This code not needed for building within CMake.
if(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "Linux" OR
CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR
+ CMAKE_SYSTEM_NAME STREQUAL "SunOS" OR
CMAKE_SYSTEM_NAME STREQUAL "GNU/kFreeBSD" OR
# FreeBSD comes with the a.out and elf flavours
@@ -158,6 +159,17 @@ if(WIN32)
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
endif()
endif()
+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)
+{
+ (void)argc;
+ argv[0][0] = ' ';
+ return (argv[0][0] == ' ')?0:1;
+}"
+ HAVE_WRITABLE_ARGV)
endif()
target_include_directories(${LIB_NAME} INTERFACE