Skip to content

Add option to force finding libftdi1 using pkg-config until MSYS2 pac…#670

Closed
cr1901 wants to merge 1 commit into
trabucayre:masterfrom
cr1901:force-libftdi1-pc
Closed

Add option to force finding libftdi1 using pkg-config until MSYS2 pac…#670
cr1901 wants to merge 1 commit into
trabucayre:masterfrom
cr1901:force-libftdi1-pc

Conversation

@cr1901

@cr1901 cr1901 commented May 25, 2026

Copy link
Copy Markdown
Contributor

…kage is patched.

The LibFTDI1Config.cmake module in MSYS2/MINGW-packages hardcodes paths in a way that Ninja (at least) cannot find the dependency libusb when trying to build OFL. The old pkg-config method of finding the dep still works fine, however. So add an option to force the old way until a fix finds its way upstream.

(I'm taking a peek at it, but seems more difficult to fix than I thought.)

@cr1901 cr1901 marked this pull request as draft May 25, 2026 18:46
Comment thread CMakeLists.txt
endif()

if (USE_LIBFTDI)
if (USE_LIBFTDI AND LINK_CMAKE_LIBFTDI1)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, maybe this isn't the proper fix. When configuring with pkg-config, I get:

CMake Error at CMakeLists.txt:832 (math):
  math cannot parse the expression: " * 100 + ": syntax error, unexpected
  exp_TIMES (2).

But probably better to fix it for pkg-config than to gate it out.

@trabucayre

trabucayre commented May 28, 2026

Copy link
Copy Markdown
Owner

Thanks to point this issue.
In fact I have removed find_package: this approach is in many cases error prone.
See c6ca4e5
Could you test with an up to date git to see if this fix your issue?

@cr1901

cr1901 commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

@trabucayre Your commit works fine. Closing this PR. Maybe in the future, find_package can be reintroduced... it seems more integrated w/ cmake, so in principle plays nicer with Windows (which aside from MSYS2 doesn't exactly have well-defined library locations). But that can be handled another day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants