Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ option(ENABLE_OPTIM "Enable build with -O3 optimization level"
option(BUILD_STATIC "Whether or not to build with static libraries" OFF)
option(USE_PKGCONFIG "Use pkgconfig to find libraries" ON)
option(LINK_CMAKE_THREADS "Use CMake find_package to link the threading library" OFF)
option(LINK_CMAKE_LIBFTDI1 "Use CMake find_package to link the libftdi1 library" ON)
option(WINDOWS_CROSSCOMPILE "Enable cross-compile on windows" OFF)
option(WINDOWS_STATIC_ZLIB "Link zlib statically for Windows builds" ON)

Expand Down Expand Up @@ -188,7 +189,7 @@ add_definitions(-DVIVADO_DIR=\"${VIVADO_PATH}\")
# Dependencies check/search
####################################################################################################

if (USE_LIBFTDI)
if (USE_LIBFTDI AND LINK_CMAKE_LIBFTDI1)
# Try to find the LibFTDI1 with cmake
find_package(LibFTDI1 QUIET)
endif()
Expand Down Expand Up @@ -825,7 +826,7 @@ if (LINK_CMAKE_THREADS)
target_link_libraries(openFPGALoader Threads::Threads)
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.

# libftdi < 1.4 as no usb_addr
# libftdi >= 1.5 as purge_buffer obsolete
math(EXPR FTDI_VAL "${LIBFTDI_VERSION_MAJOR} * 100 + ${LIBFTDI_VERSION_MINOR}")
Expand Down
Loading