[llvm-commits] [llvm] r119058 - /llvm/trunk/CMakeLists.txt

Frits van Bommel fvbommel at gmail.com
Sun Nov 14 11:56:17 PST 2010


On Sun, Nov 14, 2010 at 8:12 PM, Chris Lattner <sabre at nondot.org> wrote:
> +  if( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/*AsmPrinter.cpp )
> +    set(LLVM_ENUM_ASM_PRINTERS
> +      "${LLVM_ENUM_ASM_PRINTERS}LLVM_ASM_PRINTER(${t})\n")
> +  endif( EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Target/${t}/AsmPrinter/CMakeLists.txt )

This produces a large amount of warnings. For every target, it
produces this warning:
=====
CMake Warning (dev) in CMakeLists.txt:
  A logical block opening on the line

    [...]/llvm/trunk/CMakeLists.txt:331 (if)

  closes on the line

    [...]/llvm/trunk/CMakeLists.txt:334 (endif)

  with mis-matching arguments.
This warning is for project developers.  Use -Wno-dev to suppress it.
======

And worse, it doesn't find *any* asm printers. Turns out CMake's
"if(EXISTS" doesn't support globs. The attached patch fixes both
issues AFAICT. It seems to detect all asm printers (including both of
the ones not named ${t}/${t}AsmPrinter.cpp), compiles without errors
or warnings, and produces no CMake warnings.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: asmprinter-detection.patch
Type: text/x-diff
Size: 838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101114/f1677d86/attachment.patch>


More information about the llvm-commits mailing list