I would like to use the build system of llvm to build my tool that is based on clang.
I made a new directory under clang/tools with the name of the tool “polyextract”. I copied the CMakelist.txt and Makefile from the clang-cc and modified them
I then configure from llvm trunk and make, but unfortunately I only get the object file generated and no executable is generated in the Debug/bin
I would appreciate your help. Sorry I am not familiar with the build systems.
I have managed to get it the executable generated by adding my directory
to the Makefile in clang/tools directory.
This is also what we do for our tool. Which reminds me that it would be
nice to have tools/Makefile and CMakeLists.txt automatically detect and
build additional tools. I'll suggest a patch.
So the LLVM and Clang uses a mix of cmake and Makefiles? Can you give an
abstract view of how the build process works?
LLVM can be built with either CMake or "../src/configure; make". They
are mostly equivalent.
The simple way is to use llvm/clang as static/shared libraries. You
can put your source files wherever you want, and write a Makefile
manually, like this:
INCLUDE = -I$(HOME)/llvm/include -I$(HOME)/llvm/tools/clang/include