Skip to content

tobpro87/UsingClang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using Clang as a Library

Preface

Please look at in the Clang documentation as a reference.

Building

Requirements

  • LLVM 3.9.0+ (for libClang)
  • A C++11 compliant compiler

Build

Create a build directory.

mkdir build && cd build

Export required environment variables

export LLVM_DIR=<path-to-clang-and-llvm-3.9.0>/lib/cmake/llvm
export Clang_DIR=<path-to-clang-and-llvm-3.9.0>/lib/cmake/clang

Generate a build system using any desired generator in CMake. e.g "Unix Makefiles"

cmake -G "Unix Makefiles" ../

Build - you can use any IDE if applicable to the generator, but you can also just build straight from CMake.

cmake --build .

Provided Examples

RecursiveASTVisitor based ASTFrontendActions

About

Using Clang as a Library - Examples based on Clang documentation Edit

Resources

License

Stars

Watchers

Forks

Packages

No packages published