Patch: [CMake] Wrong parsing of ADDITIONAL_HEADERS in llvm_add_library

NAKAMURA Takumi geek4civic at gmail.com
Wed Feb 12 17:08:54 PST 2014


Michael,

Sure, I was insightless. Fixed in r201283, thanks!
FYI, cmake_parse_arguments() doesn't collate each duplicated
parameter, it seems.

2014-02-13 8:52 GMT+09:00 Michael Kruse <llvm-commits at meinersbur.de>:
> The signature of llvm_add_library purposefully omitted
> ADDITIONAL_HEADERS to be handled by llvm_process_sources. However, if
> invoked, the string "ADDITIONAL_HEADERS" will be interpreted as an
> argument of the previous named parameter and thus not becoming a part
> of ARG_UNPARSED_ARGUMENTS.
>
> For instance, calling
> add_clang_library(clangAST APValue.cpp ... LINK_LIBS clangBasic clangLex)
> will append *.h files as
> llvm_add_library(clangAST APValue.cpp ... LINK_LIBS clangBasic
> clangLex ADDITIONAL_HEADERS AST.h ...)
> thus causing
> target_link_libraries(clangAST clangBasic clangLex ADDITIONAL_HEADERS AST.h ...)
> and try to link clangAST with some file ADDITIONAL_HEADERS.lib and the
> header files.
>
> (I don't have commit rights)
>
> Btw, previously there was some discussion whether such wrappers make
> sense. I am in favor of them. For one, add_llvm_library is already a
> wrapper around the intrinsic add_library, so nothing new is
> introduced. It also removes code duplication because code for the same
> task like llvm_process_sources is avoided. Lastly, the parameter
> LINK_LIBS -- knowing the required libraries in advance -- allows
> things like determining if the type of the library and add then using
> $<TARGET_OBJECTS> instead if possible. OBJECT libraries allow
> incremental linking in Visual Studio.
>
> Regards,
> Michael Kruse
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list