Failing to CMake standalone clang-interpreter

Hello List,

I'm trying to build clang-interpreter as a standalone project using CMake but am getting lots of undefined references in the linking stage. Platform is Linux, using latest llvm & clang off SVN built into /usr/local prefix using CMake.

I basically copied a slightly stripped down version of llvm/tools/clang/CMakeLists.txt into my project's root dir. [0]

The project root dir's CMakeLists.txt includes subdirectory ./src in which clang-interpreter.cpp is (which was taken from llvm/tools/clang/examples/clang-interpreter/). Also one can find src/CMakeLists.txt, which is essentially a copy of llvm/tools/clang/examples/clang-interpreter/CMakeLists.txt, but with more LLVM_LINK_COMPONENTS added [1].


   mkdir build -p && \
     cd build && \
     cmake .. -DCLANG_PATH_TO_LLVM_BUILD=/usr/local && \

... results in lots of undefined references in the linking stage [2].

Does anyone know what I'm doing wrong here? Would very much appreciate any pointers.

Many thanks,


[0] test-prj/CMakeLists.txt:
[1] test-prj/src/CMakeLists.txt:
[2] Build output: