libftdi Archives

Subject: Re: purge_test not compatible with MinGW

From: Xiaofan Chen <xiaofanc@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Fri, 31 Jul 2020 10:25:45 +0800
On Wed, Jul 22, 2020 at 4:27 PM Xiaofan Chen <xiaofanc@xxxxxxxxx> wrote:
>
> On Tue, Jul 21, 2020 at 5:14 PM Thomas Jarosch
> <thomas.jarosch@xxxxxxxxxxxxx> wrote:
> > You wrote on Sat, Jul 18, 2020 at 08:42:01PM +0800:
> > > termios.h is not available so the build of purge_test will fail
> > > under Windows with MinGW. Tested with MSYS2.
> >
> > hmm, good point. We seem to have another "MINGW" conditional already.
> > Or is it better to just look for "WIN32"?
>
> I think we should look for MINGW. Cygwin has termios.h.
>
> > Could you prepare a small patch to skip the binary & test it?
>
> Okay, let me try. I do not know much about CMake.
>

The following change seems to work. Please check. Thanks.

$ git log
commit 5a71aec2397add6b80fa03f6d5563eaf35f8eb81 (HEAD -> master)
Author: Xiaofan Chen <xiaofanc@xxxxxxxxx>
Date:   Fri Jul 31 10:21:19 2020 +0800

    Ignore purge_test example build for MinGW since termios.h is not available

diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 6fc3c09..dd8ffbe 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -15,7 +15,9 @@ add_executable(baud_test baud_test.c)
 add_executable(stream_test stream_test.c)
 add_executable(eeprom eeprom.c)
 add_executable(async async.c)
-add_executable(purge_test purge_test.c)
+if(NOT MINGW)
+    add_executable(purge_test purge_test.c)
+endif(NOT MINGW)

 # Linkage
 target_link_libraries(simple ftdi1)
@@ -29,7 +31,9 @@ target_link_libraries(baud_test ftdi1)
 target_link_libraries(stream_test ftdi1)
 target_link_libraries(eeprom ftdi1)
 target_link_libraries(async ftdi1)
-target_link_libraries(purge_test ftdi1)
+if(NOT MINGW)
+    target_link_libraries(purge_test ftdi1)
+endif(NOT MINGW)

 # libftdi++ examples
 if( FTDIPP )




--
Xiaofan

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

Current Thread