diff --git a/docs/CMake.html b/docs/CMake.html index 6778d6b7315..73e6f440e30 100644 --- a/docs/CMake.html +++ b/docs/CMake.html @@ -22,6 +22,9 @@
It is possible to develop LLVM passes against installed LLVM. + An example of project layout provided below:
+ ++ <project dir>/ + | + CMakeLists.txt + <pass name>/ + | + CMakeLists.txt + Pass.cpp + ... ++
Contents of <project dir>/CMakeLists.txt:
+ ++ find_package(LLVM) + + # Define add_llvm_* macro's. + include(AddLLVM) + + add_definitions(${LLVM_DEFINITIONS}) + include_directories(${LLVM_INCLUDE_DIRS}) + link_directories(${LLVM_LIBRARY_DIRS}) + + add_subdirectory(<pass name>) ++
Contents of <project dir>/<pass name>/CMakeLists.txt:
+ ++ add_llvm_loadable_module(LLVMPassname + Pass.cpp + ) ++
When you are done developing your pass, you may wish to integrate it
+ into LLVM source tree. You can achieve it in two easy steps:
+ 1. Copying <pass name> folder into <LLVM root>/lib/Transform directory.
+ 2. Adding "add_subdirectory(<pass name>)" line into <LLVM root>/lib/Transform/CMakeLists.txt
If you are used CMake to build LLVM, see +Developing an LLVM pass with CMake.
+Now that we have the build scripts set up, we just need to write the code for the pass itself.