From a134da45c4436551bd62c4d81b7e3998c11611fe Mon Sep 17 00:00:00 2001 From: Joaquim Date: Mon, 3 Aug 2026 00:03:37 +0100 Subject: [PATCH] Limit the compilation of gmt_update to MSVC only (Still having troubles to make it compile in Yggdrasil (for Julia)) --- src/CMakeLists.txt | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c379a0b996f..781ba594265 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -603,18 +603,20 @@ target_link_libraries (gshhg_version ${NETCDF_LIBRARIES}) # script2verbatim for removing comments, replacing -ps from example scripts add_executable (script2verbatim script2verbatim.c) -option(WITH_GMT_UPDATE "Build and install gmt_update executable" ON) -if (WITH_GMT_UPDATE) - # gmt_update — standalone binary updater. Deliberately does NOT link against - # libgmt/pslib so that those DLLs are NOT held open by this process and can be - # replaced on Windows. Uses only libcurl + an embedded public-domain SHA-256. - add_executable (gmt_update gmt_update.c sha256.c) - target_include_directories (gmt_update PRIVATE ${CURL_INCLUDE_DIRS}) - target_link_libraries (gmt_update ${CURL_LIBRARIES}) - if (WIN32) - target_link_libraries (gmt_update rstrtmgr) - endif (WIN32) - install (TARGETS gmt_update RUNTIME DESTINATION ${GMT_BINDIR} COMPONENT Runtime) +if (MSVC) + option(WITH_GMT_UPDATE "Build and install gmt_update executable" ON) + if (WITH_GMT_UPDATE) + # gmt_update — standalone binary updater. Deliberately does NOT link against + # libgmt/pslib so that those DLLs are NOT held open by this process and can be + # replaced on Windows. Uses only libcurl + an embedded public-domain SHA-256. + add_executable (gmt_update gmt_update.c sha256.c) + target_include_directories (gmt_update PRIVATE ${CURL_INCLUDE_DIRS}) + target_link_libraries (gmt_update ${CURL_LIBRARIES}) + if (WIN32) + target_link_libraries (gmt_update rstrtmgr) + endif (WIN32) + install (TARGETS gmt_update RUNTIME DESTINATION ${GMT_BINDIR} COMPONENT Runtime) + endif() endif()