Skip to content

Commit

Permalink
[libftdi] resolve ninja error (-w dupbuild=err) (microsoft#7055)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rastaban authored Jun 26, 2019
1 parent 539695e commit 40537b8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 28 deletions.
2 changes: 1 addition & 1 deletion ports/libftdi/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: libftdi
Version: 0.20
Version: 0.20-1
Build-Depends: libusb-win32
Description: FTDI USB driver with bitbang mode (v0.20)
24 changes: 0 additions & 24 deletions ports/libftdi/export-cmake.patch

This file was deleted.

1 change: 0 additions & 1 deletion ports/libftdi/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ vcpkg_extract_source_archive_ex(
PATCHES
libusb-win32.patch
shared-static.patch
export-cmake.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/exports.def DESTINATION ${SOURCE_PATH}/src)
Expand Down
18 changes: 16 additions & 2 deletions ports/libftdi/shared-static.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 071ae90..b42bbcd 100644
index 071ae90..f91f6f7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,7 +4,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}
Expand All @@ -11,6 +11,15 @@ index 071ae90..b42bbcd 100644
set(c_headers ftdi.h)

add_library(ftdi SHARED ${c_sources})
@@ -14,7 +14,7 @@ set_target_properties(ftdi PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.

# Static library
add_library(ftdi-static STATIC ${c_sources})
-set_target_properties(ftdi-static PROPERTIES OUTPUT_NAME "ftdi")
+set_target_properties(ftdi-static PROPERTIES OUTPUT_NAME "ftdi-static")

# Prevent clobbering each other during the build
set_target_properties(ftdi PROPERTIES CLEAN_DIRECT_OUTPUT 1)
@@ -24,7 +24,7 @@ set_target_properties(ftdi-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
target_link_libraries(ftdi ${LIBUSB_LIBRARIES})

Expand All @@ -20,7 +29,7 @@ index 071ae90..b42bbcd 100644

install( TARGETS ftdi
LIBRARY DESTINATION lib${LIB_SUFFIX}
@@ -41,23 +41,24 @@ if(${UNIX})
@@ -41,23 +41,29 @@ if(${UNIX})
COMPONENT headers
)

Expand All @@ -33,15 +42,20 @@ index 071ae90..b42bbcd 100644
+ if(BUILD_SHARED_LIBS)
install( TARGETS ftdi
- DESTINATION bin
+ EXPORT ftdi
COMPONENT sharedlibs
)

+ target_link_libraries(ftdi PUBLIC $<INSTALL_INTERFACE:include>)
+ else()
install( TARGETS ftdi-static
- DESTINATION bin
+ EXPORT ftdi
COMPONENT staticlibs
)
+ target_link_libraries(ftdi-static PUBLIC $<INSTALL_INTERFACE:include>)
+ endif()
+ install(EXPORT ftdi FILE libftdi-config.cmake NAMESPACE libftdi:: DESTINATION share/libftdi)

install( FILES ${c_headers}
DESTINATION include
Expand Down

0 comments on commit 40537b8

Please sign in to comment.