aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/libftdi1/linkage.diff
blob: 5bc19ef52520759c77fa140d0ab34fef5465a327 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt
index fac5bcc..8a20a04 100644
--- a/ftdipp/CMakeLists.txt
+++ b/ftdipp/CMakeLists.txt
@@ -11,6 +11,11 @@ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}
 
 include_directories(${Boost_INCLUDE_DIRS})
 
+if(WIN32)
+	set(BUILD_SHARED_LIBS OFF)
+	set(STATICLIBS ON)
+endif()
+if(BUILD_SHARED_LIBS)
 # Shared library
 add_library(ftdipp1 SHARED ${cpp_sources})
 
@@ -28,6 +33,7 @@ install ( TARGETS ftdipp1
 					LIBRARY DESTINATION lib${LIB_SUFFIX}
 					ARCHIVE DESTINATION lib${LIB_SUFFIX}
 				)
+endif()
 
 # Static library
 if ( STATICLIBS )
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 17b3617..087fba8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,8 +19,12 @@ configure_file(ftdi_version_i.h.in "${CMAKE_CURRENT_BINARY_DIR}/ftdi_version_i.h
 
 # Targets
 set(c_sources     ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/ftdi_stream.c CACHE INTERNAL "List of c sources" )
+if(WIN32)
+  set(c_sources     ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.c ${CMAKE_CURRENT_SOURCE_DIR}/exports.def 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})
 
 math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")    # Compatibility with previous releases
@@ -37,6 +41,7 @@ install ( TARGETS ftdi1
           LIBRARY DESTINATION lib${LIB_SUFFIX}
           ARCHIVE DESTINATION lib${LIB_SUFFIX}
         )
+endif()
 
 if ( STATICLIBS )
   add_library(ftdi1-static STATIC ${c_sources})