[llvm-bugs] [Bug 47003] New: llvm_map_components_to_libnames(llvm_libs all) does not populate llvmlibs

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 5 07:52:16 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47003

            Bug ID: 47003
           Summary: llvm_map_components_to_libnames(llvm_libs all) does
                    not populate llvmlibs
           Product: Build scripts
           Version: 10.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: vhaenel at anaconda.com
                CC: llvm-bugs at lists.llvm.org

I have recently encountered an issue where the following stanza:

llvm_map_components_to_libnames(llvm_libs all)

Did not populate 'llvm_libs'.

To reproduce, bulid out llvm 10.0.1 and then use the following CMakeLists.txt
to build a sample project:

```
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.13.4)
project(SimpleProject)

find_package(LLVM REQUIRED CONFIG)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")

# Set your project compile flags.
# E.g. if using the C++ header files
# you will need to enable C++11 support
# for your compiler.

include_directories(${LLVM_INCLUDE_DIRS})
add_definitions(${LLVM_DEFINITIONS})

# Find the libraries that correspond to the LLVM components
# that we wish to use
llvm_map_components_to_libnames(llvm_libs all)

message("llvm_libs is ${llvm_libs}")
```

You can then invoke the sample project using a call like:

```
$cmake  -DLLVM_DIR=../llvm-build-10.0.1/cmake/modules/CMakeFiles/ .
-- Found LLVM 10.0.1
-- Using LLVMConfig.cmake in: ../llvm-build-10.0.1/cmake/modules/CMakeFiles/
llvm_libs is
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/user/git/sample_llvm_cmake_project
```

And as you can see, 'llvm_libs'  is empty. I was expecting all the components
to be listed, because of using 'all'. But 'all'  should be supported:

```
$ ../llvm-build-10.0.1/bin/llvm-config --components
aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler
aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm
armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser
asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen
core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym
debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine
executionengine extensions frontendopenmp fuzzmutate globalisel gtest
gtest_main instcombine instrumentation interpreter ipo irreader jitlink
libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser
native nativecodegen objcarcopts object objectyaml option orcerror orcjit
passes profiledata remarks runtimedyld scalaropts selectiondag support
symbolize tablegen target testingsupport textapi transformutils vectorize
windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info
x86utils xray
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200805/d415d0c8/attachment-0001.html>


More information about the llvm-bugs mailing list