[PATCH] D86521: Revert "Use find_library for ncurses"

Mateusz MikuĊ‚a via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 27 08:52:41 PDT 2020


mati865 added a comment.

FYI this doesn't fully fix MinGW issue:

  $ cat tools/llvm-config/BuildVariables.inc | grep LLVM_SYSTEM_LIBS
  #define LLVM_SYSTEM_LIBS "-lpsapi -lshell32 -lole32 -luuid -ladvapi32 -lz.dll"

It's because libraries are found by their import library which is `libz.dll.a` in this case.
`libz.dll.a` matches `if` in line 213 and gets stripped to `z.dll` which doesn't match shared library regex `lib.*\.dll`.

The easiest fix would be adding:

  if(CMAKE_IMPORT_LIBRARY_PREFIX AND CMAKE_IMPORT_LIBRARY_SUFFIX AND
      zlib_library MATCHES "^${CMAKE_IMPORT_LIBRARY_PREFIX}.*${CMAKE_IMPORT_LIBRARY_SUFFIX }$")
    STRING(REGEX REPLACE "^${CMAKE_IMPORT_LIBRARY_PREFIX}" "" zlib_library ${zlib_library})
    STRING(REGEX REPLACE "${CMAKE_IMPORT_LIBRARY_SUFFIX }$" "" zlib_library ${zlib_library})
  endif()

Should it fixed in separate diff given the fact this is a revert?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86521/new/

https://reviews.llvm.org/D86521



More information about the llvm-commits mailing list