ftdi_eeprom: fix static build master
authorYegor Yefremov <yegorslists@googlemail.com>
Fri, 13 Jun 2025 07:59:39 +0000 (09:59 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Fri, 13 Jun 2025 10:45:20 +0000 (12:45 +0200)
Link to ftdi1-static if only STATICLIBS is enabled.

ftdi_eeprom/CMakeLists.txt

index 3958b66..38147b5 100644 (file)
@@ -36,7 +36,12 @@ configure_file(
 )
 
 add_executable(ftdi_eeprom main.c)
-target_link_libraries(ftdi_eeprom ftdi1 ${CONFUSE_LIBRARIES})
+if (NOT SHAREDLIBS AND STATICLIBS)
+    target_link_libraries(ftdi_eeprom ftdi1-static)
+else()
+    target_link_libraries(ftdi_eeprom ftdi1)
+endif ()
+target_link_libraries(ftdi_eeprom ${CONFUSE_LIBRARIES})
 if (LIBINTL_FOUND)
     target_link_libraries(ftdi_eeprom ${LIBINTL_LIBRARIES})
 endif ()