libftdi Archives

Subject: MSVC build of libftdi git

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 26 Aug 2011 22:30:16 +0800
I remember Michael Plante mentioned that libfti was able to be built under
Visual Studio. So out of curiosity, I used CMake to generate the VS2010
project file (32bit) and indeed the library build is okay. Only 2
examples can be built though.

The generated dll file is ftdi.dll and the generated lib file is
ftdi.lib but I think the proper name is actually libftdi.dll
and libftdi.lib (for MSVC).

It might be good to fix the MSVC build as well for the
examples.

The examples/CMakeLists.txt needs a bit of fix to work under
Windows. I think this might not be the proper fix (as I do
not know much about CMake).

 examples/CMakeLists.txt |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index d2aeecb..a54f174 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -2,9 +2,9 @@ option(EXAMPLES "Build example programs" ON)

 if (EXAMPLES)
     # Includes
-    include( ${CMAKE_CURRENT_SOURCE_DIR}
-            ${CMAKE_CURRENT_BINARY_DIR}
-            )
+    #include( ${CMAKE_CURRENT_SOURCE_DIR}
+    #        ${CMAKE_CURRENT_BINARY_DIR}
+    #        )

     message(STATUS "Building example programs.")

The build log:
1>------ Build started: Project: ZERO_CHECK, Configuration: Debug Win32 ------
1>  Checking Build System
1>  CMake does not need to re-run because
D:/work/libftdi/libftdi/build_vs2010/CMakeFiles/generate.stamp is
up-to-date.
1>  CMake does not need to re-run because
D:/work/libftdi/libftdi/build_vs2010/src/CMakeFiles/generate.stamp is
up-to-date.
1>  CMake does not need to re-run because
D:/work/libftdi/libftdi/build_vs2010/ftdipp/CMakeFiles/generate.stamp
is up-to-date.
1>  CMake does not need to re-run because
D:/work/libftdi/libftdi/build_vs2010/bindings/CMakeFiles/generate.stamp
is up-to-date.
1>  CMake does not need to re-run because
D:/work/libftdi/libftdi/build_vs2010/examples/CMakeFiles/generate.stamp
is up-to-date.
1>  CMake does not need to re-run because
D:/work/libftdi/libftdi/build_vs2010/packages/CMakeFiles/generate.stamp
is up-to-date.
2>------ Build started: Project: ftdi, Configuration: Debug Win32 ------
3>------ Build started: Project: ftdi-static, Configuration: Debug Win32 ------
2>  Building Custom Rule D:/work/libftdi/libftdi/src/CMakeLists.txt
3>  Building Custom Rule D:/work/libftdi/libftdi/src/CMakeLists.txt
3>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\src\CMakeFiles\generate.stamp is
up-to-date.
2>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\src\CMakeFiles\generate.stamp is
up-to-date.
2>  ftdi.c
3>  ftdi.c
2>D:\work\libftdi\libftdi\src\ftdi.c(87): warning C4101: 'i' :
unreferenced local variable
2>D:\work\libftdi\libftdi\src\ftdi.c(1552): warning C4018: '<=' :
signed/unsigned mismatch
2>D:\work\libftdi\libftdi\src\ftdi.c(2406): warning C4244: '=' :
conversion from 'unsigned short' to 'unsigned char', possible loss of
data
2>D:\work\libftdi\libftdi\src\ftdi.c(2430): warning C4101:
'size_check' : unreferenced local variable
3>D:\work\libftdi\libftdi\src\ftdi.c(87): warning C4101: 'i' :
unreferenced local variable
3>D:\work\libftdi\libftdi\src\ftdi.c(1552): warning C4018: '<=' :
signed/unsigned mismatch
3>D:\work\libftdi\libftdi\src\ftdi.c(2406): warning C4244: '=' :
conversion from 'unsigned short' to 'unsigned char', possible loss of
data
3>D:\work\libftdi\libftdi\src\ftdi.c(2430): warning C4101:
'size_check' : unreferenced local variable
3>  ftdi-static.vcxproj ->
D:\work\libftdi\libftdi\build_vs2010\src\Debug\ftdi.lib
2>  ftdi.vcxproj -> D:\work\libftdi\libftdi\build_vs2010\src\Debug\ftdi.dll
4>------ Build started: Project: serial_read, Configuration: Debug Win32 ------
5>------ Build started: Project: find_all, Configuration: Debug Win32 ------
4>  Building Custom Rule D:/work/libftdi/libftdi/examples/CMakeLists.txt
5>  Building Custom Rule D:/work/libftdi/libftdi/examples/CMakeLists.txt
5>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\examples\CMakeFiles\generate.stamp
is up-to-date.
4>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\examples\CMakeFiles\generate.stamp
is up-to-date.
5>  find_all.c
4>  serial_read.c
4>D:\work\libftdi\libftdi\examples\serial_read.c(9): fatal error
C1083: Cannot open include file: 'unistd.h': No such file or directory
6>------ Build started: Project: bitbang_ft2232, Configuration: Debug
Win32 ------
6>  Building Custom Rule D:/work/libftdi/libftdi/examples/CMakeLists.txt
6>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\examples\CMakeFiles\generate.stamp
is up-to-date.
6>  bitbang_ft2232.c
6>D:\work\libftdi\libftdi\examples\bitbang_ft2232.c(12): fatal error
C1083: Cannot open include file: 'unistd.h': No such file or directory
7>------ Build started: Project: bitbang_cbus, Configuration: Debug Win32 ------
7>  Building Custom Rule D:/work/libftdi/libftdi/examples/CMakeLists.txt
7>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\examples\CMakeFiles\generate.stamp
is up-to-date.
7>  bitbang_cbus.c
7>D:\work\libftdi\libftdi\examples\bitbang_cbus.c(33): fatal error
C1083: Cannot open include file: 'unistd.h': No such file or directory
5>  find_all.vcxproj ->
D:\work\libftdi\libftdi\build_vs2010\examples\Debug\find_all.exe
8>------ Build started: Project: bitbang2, Configuration: Debug Win32 ------
8>  Building Custom Rule D:/work/libftdi/libftdi/examples/CMakeLists.txt
8>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\examples\CMakeFiles\generate.stamp
is up-to-date.
9>------ Build started: Project: bitbang, Configuration: Debug Win32 ------
8>  bitbang2.c
9>  Building Custom Rule D:/work/libftdi/libftdi/examples/CMakeLists.txt
9>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\examples\CMakeFiles\generate.stamp
is up-to-date.
9>  bitbang.c
9>D:\work\libftdi\libftdi\examples\bitbang.c(4): fatal error C1083:
Cannot open include file: 'unistd.h': No such file or directory
8>D:\work\libftdi\libftdi\examples\bitbang2.c(33): fatal error C1083:
Cannot open include file: 'unistd.h': No such file or directory
10>------ Build started: Project: baud_test, Configuration: Debug Win32 ------
11>------ Build started: Project: simple, Configuration: Debug Win32 ------
10>  Building Custom Rule D:/work/libftdi/libftdi/examples/CMakeLists.txt
11>  Building Custom Rule D:/work/libftdi/libftdi/examples/CMakeLists.txt
11>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\examples\CMakeFiles\generate.stamp
is up-to-date.
10>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\examples\CMakeFiles\generate.stamp
is up-to-date.
10>  baud_test.c
11>  simple.c
10>D:\work\libftdi\libftdi\examples\baud_test.c(32): fatal error
C1083: Cannot open include file: 'sys/time.h': No such file or
directory
11>  simple.vcxproj ->
D:\work\libftdi\libftdi\build_vs2010\examples\Debug\simple.exe
12>------ Build started: Project: ALL_BUILD, Configuration: Debug Win32 ------
12>  Build all projects
12>  Building Custom Rule D:/work/libftdi/libftdi/CMakeLists.txt
12>  CMake does not need to re-run because
D:\work\libftdi\libftdi\build_vs2010\CMakeFiles\generate.stamp is
up-to-date.
13>------ Skipped Build: Project: INSTALL, Configuration: Debug Win32 ------
13>Project not selected to build for this solution configuration
14>------ Skipped Build: Project: PACKAGE, Configuration: Debug Win32 ------
14>Project not selected to build for this solution configuration
========== Build: 6 succeeded, 6 failed, 0 up-to-date, 2 skipped ==========

1>------ Build started: Project: ZERO_CHECK, Configuration: Release Win32 ------
2>------ Build started: Project: ftdi, Configuration: Release Win32 ------
2>  ftdi.vcxproj -> D:\work\libftdi\libftdi\build_vs2010\src\Release\ftdi.dll
3>------ Build started: Project: serial_read, Configuration: Release
Win32 ------
4>------ Build started: Project: bitbang_ft2232, Configuration:
Release Win32 ------
3>  serial_read.c
4>  bitbang_ft2232.c
3>D:\work\libftdi\libftdi\examples\serial_read.c(9): fatal error
C1083: Cannot open include file: 'unistd.h': No such file or directory
4>D:\work\libftdi\libftdi\examples\bitbang_ft2232.c(12): fatal error
C1083: Cannot open include file: 'unistd.h': No such file or directory
5>------ Build started: Project: bitbang_cbus, Configuration: Release
Win32 ------
6>------ Build started: Project: bitbang2, Configuration: Release Win32 ------
5>  bitbang_cbus.c
6>  bitbang2.c
5>D:\work\libftdi\libftdi\examples\bitbang_cbus.c(33): fatal error
C1083: Cannot open include file: 'unistd.h': No such file or directory
6>D:\work\libftdi\libftdi\examples\bitbang2.c(33): fatal error C1083:
Cannot open include file: 'unistd.h': No such file or directory
7>------ Build started: Project: bitbang, Configuration: Release Win32 ------
7>  bitbang.c
7>D:\work\libftdi\libftdi\examples\bitbang.c(4): fatal error C1083:
Cannot open include file: 'unistd.h': No such file or directory
8>------ Build started: Project: baud_test, Configuration: Release Win32 ------
8>  baud_test.c
8>D:\work\libftdi\libftdi\examples\baud_test.c(32): fatal error C1083:
Cannot open include file: 'sys/time.h': No such file or directory
9>------ Build started: Project: ALL_BUILD, Configuration: Release Win32 ------
9>  Build all projects
10>------ Skipped Build: Project: INSTALL, Configuration: Release Win32 ------
10>Project not selected to build for this solution configuration
11>------ Skipped Build: Project: PACKAGE, Configuration: Release Win32 ------
11>Project not selected to build for this solution configuration
========== Build: 3 succeeded, 6 failed, 3 up-to-date, 2 skipped ==========


-- 
Xiaofan

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread