Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clang-libtooling-experiments

Experiments developing tools using Clang LibTooling.

Standalone Build

LLVM/CLANG takes forever to build. To expedite development on tools a standalone build is established following docs. This step is carried out by build_standalone_llvm_clang.py1 which loads configurations from llvm-build-config.jsonc2.

The assumed default directory structure is as follows:

<root>
+---llvm
+---clang-libtooling-experiments
|   +---build_standalone_llvm_clang.py
|   \---example
+---build-llvm
+---build-clang
+---llvm-release

Python Setup Helper

The setup_llvm_clang.py module exists to help establish this dependency.

  • py setup_llvm_clang.py -h to see help output
  1. py setup_llvm_clang.py --writeconfig to create the default configuration file: llvm-config.json
    • Change as necessary (desired directories and vcvarsbat)
    • NOTE: this will overwrite llvm-config.json if it exists!
  2. py setup_llvm_clang.py --clone to clone the required LLVM repo (out of tree).
  3. py setup_llvm_clang.py --llvm --clang to compile the dependencies.

NOTE Once LLVM/Clang is compiled the resource should be maintained to mitigate lengthy compile times in the future.

Default Configuration

The default configuration will result in the following hierarchy when py setup_llvm_clang.py --clone --llvm --clang is executed from this directory:

. <root-dir>
/binder (*this*)
    setup_llvm_clang.py
    llvm-config.json (generated by setup_llvm_clang.py)
/llvm           .. cloned github branch (tag)
/build-llvm     .. llvm build directory
/build-clang    .. clang build directory
/llvm-reldbg    .. generated llvm/clang binaries

Footnotes

  1. Python was used to control the build process for ease in cross-platform support.

  2. JSON configuration file is used to avoid hard-coding settings and lengthy command line options.

About

Experiments developing tools using Clang LibTooling.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages