Skip to content

Commit f558e8b

Browse files
authored
Fix MinGW build failure: conditionally link libssp (#527)
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
2 parents 9dbf6a8 + 765e605 commit f558e8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,11 @@ if (SQLITECPP_BUILD_EXAMPLES)
459459

460460
target_link_libraries(SQLiteCpp_example1 SQLiteCpp)
461461
if (MSYS OR MINGW)
462-
target_link_libraries(SQLiteCpp_example1 ssp)
462+
# Check if libssp exists before linking (newer MinGW versions may not have it)
463+
find_library(SSP_LIBRARY ssp)
464+
if (SSP_LIBRARY)
465+
target_link_libraries(SQLiteCpp_example1 ${SSP_LIBRARY})
466+
endif ()
463467
endif ()
464468
else (SQLITECPP_BUILD_EXAMPLES)
465469
message(STATUS "SQLITECPP_BUILD_EXAMPLES OFF")

0 commit comments

Comments
 (0)