2019-06-22 13:45:40 +08:00
|
|
|
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
2021-02-09 10:18:42 +08:00
|
|
|
index 17b3617..f9a8e59 100755
|
2019-06-22 13:45:40 +08:00
|
|
|
--- a/src/CMakeLists.txt
|
|
|
|
+++ b/src/CMakeLists.txt
|
|
|
|
@@ -18,9 +18,14 @@ message(STATUS "Detected git snapshot version: ${SNAPSHOT_VERSION}")
|
|
|
|
configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h" @ONLY)
|
|
|
|
|
|
|
|
# Targets
|
|
|
|
+if(WIN32)
|
|
|
|
+set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/exports.def CACHE INTERNAL "List of c sources" )
|
|
|
|
+else()
|
|
|
|
set(c_sources ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" )
|
|
|
|
+endif()
|
|
|
|
set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c headers" )
|
|
|
|
|
|
|
|
+if(BUILD_SHARED_LIBS)
|
|
|
|
add_library(ftdi1 SHARED ${c_sources})
|
|
|
|
|
2021-02-09 10:18:42 +08:00
|
|
|
math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1") # Compatibility with previous releases
|
2019-06-22 13:45:40 +08:00
|
|
|
@@ -38,7 +43,7 @@ install ( TARGETS ftdi1
|
|
|
|
ARCHIVE DESTINATION lib${LIB_SUFFIX}
|
|
|
|
)
|
|
|
|
|
|
|
|
-if ( STATICLIBS )
|
|
|
|
+else()
|
|
|
|
add_library(ftdi1-static STATIC ${c_sources})
|
|
|
|
target_link_libraries(ftdi1-static ${LIBUSB_LIBRARIES})
|
|
|
|
set_target_properties(ftdi1-static PROPERTIES OUTPUT_NAME "ftdi1")
|