From 765e605b2090ff0e605914f806a32118bcb6089a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Fri, 5 Dec 2025 18:25:26 +0100 Subject: [PATCH] Fix MinGW build failure: conditionally link libssp Newer MinGW versions (e.g., GCC 15.2.0) don't provide libssp library, causing linker errors when building examples. This change makes the linking conditional by checking if the library exists before attempting to link it. Fixes GitHub Actions 'Windows Latest MinGW' build failure: - cannot find -lssp: No such file or directory --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 83b5976d..c23d634e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -459,7 +459,11 @@ if (SQLITECPP_BUILD_EXAMPLES) target_link_libraries(SQLiteCpp_example1 SQLiteCpp) if (MSYS OR MINGW) - target_link_libraries(SQLiteCpp_example1 ssp) + # Check if libssp exists before linking (newer MinGW versions may not have it) + find_library(SSP_LIBRARY ssp) + if (SSP_LIBRARY) + target_link_libraries(SQLiteCpp_example1 ${SSP_LIBRARY}) + endif () endif () else (SQLITECPP_BUILD_EXAMPLES) message(STATUS "SQLITECPP_BUILD_EXAMPLES OFF")