Re: [PATCH 1/1] cmake: do not check for g++ when FTDIPP is disabled
Hi Fabrice, You wrote on Wed, Oct 02, 2019 at 05:28:33PM +0200: > diff --git a/CMakeLists.txt b/CMakeLists.txt > index 71857d0..1e26ed4 100644 > --- a/CMakeLists.txt > +++ b/CMakeLists.txt > @@ -1,5 +1,5 @@ > # Project > -project(libftdi1) > +project(libftdi1 C) > set(MAJOR_VERSION 1) > set(MINOR_VERSION 4) > set(PACKAGE libftdi1) > diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt > index 2983d3d..37abbe3 100644 > --- a/ftdipp/CMakeLists.txt > +++ b/ftdipp/CMakeLists.txt > @@ -1,5 +1,7 @@ > # vim: ts=2:sw=2:sts=2 > > +project(libftdipp1 C CXX) thanks for upstreaming this patch. I checked it some weeks ago and I was unsure regarding the additional definition of project() in CMakeLists.txt. A search on the net didn't give a definitive answer if it's ok to call project() twice or more in a cmake project. Today I tried the patch again with Fedora 31 and it fails: $ cmake -DFTDIPP=ON ../ -- Build type: RelWithDebInfo -- Detected git snapshot version: v1.4-27-g725f9a4 -- Building ftdi_eeprom -- Summary of build options: Build static libs: ON Build C++ bindings: ON Build Python bindings: OFF Build ftdi_eeprom: ON Build examples: ON Build tests: OFF Build API documentation: OFF -- Configuring done CMake Error: Error required internal CMake variable not set, cmake may not be built correctly. Missing variable is: CMAKE_CXX_COMPILE_OBJECT CMake Error: Error required internal CMake variable not set, cmake may not be built correctly. Missing variable is: CMAKE_CXX_LINK_EXECUTABLE -- Generating done CMake Generate step failed. Build files cannot be regenerated correctly. Environment: Fedora 31 / cmake version 3.16.1 / gcc 9.2.1 Without the patch compilation is fine, tried -DFTIPP=ON and -DFTDIPP=OFF. Any idea how to proceed here? Cheers, Thomas -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to libftdi+unsubscr...@developer.intra2net.com
Re: [PATCH] libftdi: pass eeprom strings as const
Hi Dan, You wrote on Tue, Jan 07, 2020 at 11:18:30AM -0500: > These strings are not modified and it doesn't make sense that they ever > would be. Setting these as const ensures that they will not be modified > and allows const strings to be passed in without special manipulation. > > Specifically a call like the following will fail to compile: > ftdi_eeprom_set_strings(, "foo", "bar", "abc123"); > > The error will look something like this: > error: ISO C++ forbids converting a string constant to ‘char*’ > [-Werror=write-strings] thanks for the patch, applied! Given recent juggling on my side with Rust, C++ and C, I inspected the ABI of the library if anything changes at all as a precaution -> all stable. Nice tool to check for ABI changes in libs: https://lvc.github.io/abi-compliance-checker/ For testing the tool I changed the "serial" parameter bogusly from "const char *" to "char" and the tool caught it. Sweet! Cheers, Thomas -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to libftdi+unsubscr...@developer.intra2net.com
Re: [PATCH] CMake: reorder Python detection
Hi Yegor, You wrote on Mon, Jan 13, 2020 at 03:08:44PM +0100: > From: Yegor Yefremov > > PythonInterp should be detected before PythonLibs otherwise > CMake exits with the following message: > > Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) > > Signed-off-by: Yegor Yefremov > --- > python/CMakeLists.txt | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt > index fc1c3d1..5b6f420 100644 > --- a/python/CMakeLists.txt > +++ b/python/CMakeLists.txt > @@ -14,8 +14,8 @@ else () > set ( SWIG_FOUND TRUE ) >endif () > endif () > -find_package ( PythonLibs REQUIRED ) > find_package ( PythonInterp REQUIRED ) > +find_package ( PythonLibs REQUIRED ) > > include ( UseSWIG ) > include_directories ( BEFORE ${CMAKE_SOURCE_DIR}/src ) applied, thanks :) Cheers, Thomas -- libftdi - see http://www.intra2net.com/en/developer/libftdi for details. To unsubscribe send a mail to libftdi+unsubscr...@developer.intra2net.com
[PATCH] Fix typos
From: Yegor Yefremov Signed-off-by: Yegor Yefremov --- cmake/FindConfuse.cmake | 2 +- examples/async.c| 4 ++-- examples/serial_test.c | 2 +- examples/stream_test.c | 4 ++-- ftdipp/CMakeLists.txt | 2 +- ftdipp/ftdi.cpp | 2 +- python/examples/cbus.py | 2 +- src/CMakeLists.txt | 2 +- src/ftdi.c | 2 +- src/ftdi_i.h| 6 +++--- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/cmake/FindConfuse.cmake b/cmake/FindConfuse.cmake index ab25eef..f6af7d5 100644 --- a/cmake/FindConfuse.cmake +++ b/cmake/FindConfuse.cmake @@ -6,7 +6,7 @@ # CONFUSE_INCLUDE_DIR - where to find confuse.h # CONFUSE_INCLUDE_DIRS - confuse includes # CONFUSE_LIBRARY - where to find the Confuse library -# CONFUSE_LIBRARIES - aditional libraries +# CONFUSE_LIBRARIES - additional libraries # CONFUSE_ROOT_DIR - root dir (ex. /usr/local) #= diff --git a/examples/async.c b/examples/async.c index 18989c1..241bb7f 100644 --- a/examples/async.c +++ b/examples/async.c @@ -3,7 +3,7 @@ This program is distributed under the GPL, version 2 */ -/* This programm switches to MPSSE mode, and sets and then reads back +/* This program switches to MPSSE mode, and sets and then reads back * the high byte 3 times with three different values. * The expected read values are hard coded in ftdi_init * with 0x00, 0x55 and 0xaa @@ -167,7 +167,7 @@ int main(int argc, char **argv) } } if (i < 1) { -printf("Async read unsuccessfull\n"); +printf("Async read unsuccessful\n"); } } printf("Read %02x %02x %02x\n", data[0], data[1], data[2]); diff --git a/examples/serial_test.c b/examples/serial_test.c index 289dd97..0631504 100644 --- a/examples/serial_test.c +++ b/examples/serial_test.c @@ -134,7 +134,7 @@ int main(int argc, char **argv) * * TODO: Make these parameters settable from the command line * - * Parameters are choosen that sending a continous stream of 0x55 + * Parameters are chosen that sending a continuous stream of 0x55 * should give a square wave * */ diff --git a/examples/stream_test.c b/examples/stream_test.c index 43abea9..10e0977 100644 --- a/examples/stream_test.c +++ b/examples/stream_test.c @@ -10,7 +10,7 @@ * 3* uint32_t dont_care * * After start, data will be read in streaming until the program is aborted - * Progess information wil be printed out + * Progress information will be printed out * If a filename is given on the command line, the data read will be * written to that file * @@ -52,7 +52,7 @@ usage(const char *argv0) "[-n] don't check for special block structure\n" "\n" "If some filename is given, write data read to that file\n" - "Progess information is printed each second\n" + "Progress information is printed each second\n" "Abort with ^C\n" "\n" "Options:\n" diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt index a9e3418..fac5bcc 100644 --- a/ftdipp/CMakeLists.txt +++ b/ftdipp/CMakeLists.txt @@ -14,7 +14,7 @@ include_directories(${Boost_INCLUDE_DIRS}) # Shared library add_library(ftdipp1 SHARED ${cpp_sources}) -math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")# Compatiblity with previous releases +math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")# Compatibility with previous releases set_target_properties(ftdipp1 PROPERTIES VERSION ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 3) # Prevent clobbering each other during the build diff --git a/ftdipp/ftdi.cpp b/ftdipp/ftdi.cpp index dd777be..f82b865 100644 --- a/ftdipp/ftdi.cpp +++ b/ftdipp/ftdi.cpp @@ -1,5 +1,5 @@ /*** - ftdi.cpp - C++ wraper for libftdi + ftdi.cpp - C++ wrapper for libftdi --- begin: Mon Oct 13 2008 copyright: (C) 2008-2017 by Marek Vavruša / libftdi developers diff --git a/python/examples/cbus.py b/python/examples/cbus.py index 3ab9512..9c0356c 100644 --- a/python/examples/cbus.py +++ b/python/examples/cbus.py @@ -6,7 +6,7 @@ This program is distributed under the GPL, version 2. Demonstrate how to configure the FT230X USB UART bridge as follows: max_power 500 mA - CBUS3 Drive 1 (accomodate PCB error) + CBUS3 Drive 1 (accommodate PCB error) """ import sys diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9fd86a6..17b3617 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,7 +23,7 @@ set(c_headers ${CMAKE_CURRENT_SOURCE_DIR}/ftdi.h CACHE INTERNAL "List of c h add_library(ftdi1 SHARED ${c_sources}) -math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")# Compatiblity with previous releases
Re: [PATCH] Fix typos
Hi Thomas, On Thu, Jan 16, 2020 at 8:42 AM wrote: > > From: Yegor Yefremov > > Signed-off-by: Yegor Yefremov > --- > cmake/FindConfuse.cmake | 2 +- > examples/async.c| 4 ++-- > examples/serial_test.c | 2 +- > examples/stream_test.c | 4 ++-- > ftdipp/CMakeLists.txt | 2 +- > ftdipp/ftdi.cpp | 2 +- I have found out that both ftdipp/ftdi.cpp and ftdipp/ftdi.hpp are UTF-8 encoded. How can we fix this? Yegor > python/examples/cbus.py | 2 +- > src/CMakeLists.txt | 2 +- > src/ftdi.c | 2 +- > src/ftdi_i.h| 6 +++--- > 10 files changed, 14 insertions(+), 14 deletions(-) > > diff --git a/cmake/FindConfuse.cmake b/cmake/FindConfuse.cmake > index ab25eef..f6af7d5 100644 > --- a/cmake/FindConfuse.cmake > +++ b/cmake/FindConfuse.cmake > @@ -6,7 +6,7 @@ > # CONFUSE_INCLUDE_DIR - where to find confuse.h > # CONFUSE_INCLUDE_DIRS - confuse includes > # CONFUSE_LIBRARY - where to find the Confuse library > -# CONFUSE_LIBRARIES - aditional libraries > +# CONFUSE_LIBRARIES - additional libraries > # CONFUSE_ROOT_DIR - root dir (ex. /usr/local) > > > #= > diff --git a/examples/async.c b/examples/async.c > index 18989c1..241bb7f 100644 > --- a/examples/async.c > +++ b/examples/async.c > @@ -3,7 +3,7 @@ > This program is distributed under the GPL, version 2 > */ > > -/* This programm switches to MPSSE mode, and sets and then reads back > +/* This program switches to MPSSE mode, and sets and then reads back > * the high byte 3 times with three different values. > * The expected read values are hard coded in ftdi_init > * with 0x00, 0x55 and 0xaa > @@ -167,7 +167,7 @@ int main(int argc, char **argv) > } > } > if (i < 1) { > -printf("Async read unsuccessfull\n"); > +printf("Async read unsuccessful\n"); > } > } > printf("Read %02x %02x %02x\n", data[0], data[1], data[2]); > diff --git a/examples/serial_test.c b/examples/serial_test.c > index 289dd97..0631504 100644 > --- a/examples/serial_test.c > +++ b/examples/serial_test.c > @@ -134,7 +134,7 @@ int main(int argc, char **argv) > * > * TODO: Make these parameters settable from the command line > * > - * Parameters are choosen that sending a continous stream of 0x55 > + * Parameters are chosen that sending a continuous stream of 0x55 > * should give a square wave > * > */ > diff --git a/examples/stream_test.c b/examples/stream_test.c > index 43abea9..10e0977 100644 > --- a/examples/stream_test.c > +++ b/examples/stream_test.c > @@ -10,7 +10,7 @@ > * 3* uint32_t dont_care > * > * After start, data will be read in streaming until the program is aborted > - * Progess information wil be printed out > + * Progress information will be printed out > * If a filename is given on the command line, the data read will be > * written to that file > * > @@ -52,7 +52,7 @@ usage(const char *argv0) > "[-n] don't check for special block structure\n" > "\n" > "If some filename is given, write data read to that file\n" > - "Progess information is printed each second\n" > + "Progress information is printed each second\n" > "Abort with ^C\n" > "\n" > "Options:\n" > diff --git a/ftdipp/CMakeLists.txt b/ftdipp/CMakeLists.txt > index a9e3418..fac5bcc 100644 > --- a/ftdipp/CMakeLists.txt > +++ b/ftdipp/CMakeLists.txt > @@ -14,7 +14,7 @@ include_directories(${Boost_INCLUDE_DIRS}) > # Shared library > add_library(ftdipp1 SHARED ${cpp_sources}) > > -math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")# Compatiblity with > previous releases > +math(EXPR VERSION_FIXUP "${MAJOR_VERSION} + 1")# Compatibility with > previous releases > set_target_properties(ftdipp1 PROPERTIES VERSION > ${VERSION_FIXUP}.${MINOR_VERSION}.0 SOVERSION 3) > > # Prevent clobbering each other during the build > diff --git a/ftdipp/ftdi.cpp b/ftdipp/ftdi.cpp > index dd777be..f82b865 100644 > --- a/ftdipp/ftdi.cpp > +++ b/ftdipp/ftdi.cpp > @@ -1,5 +1,5 @@ > /*** > - ftdi.cpp - C++ wraper for libftdi > + ftdi.cpp - C++ wrapper for libftdi > --- > begin: Mon Oct 13 2008 > copyright: (C) 2008-2017 by Marek Vavruša / libftdi > developers > diff --git a/python/examples/cbus.py b/python/examples/cbus.py > index 3ab9512..9c0356c 100644 > --- a/python/examples/cbus.py > +++ b/python/examples/cbus.py > @@ -6,7 +6,7 @@ This program is distributed under the GPL, version 2. > > Demonstrate how to configure the FT230X USB UART bridge as follows: >max_power 500 mA > - CBUS3 Drive 1 (accomodate PCB error) > + CBUS3 Drive 1