Skip to content

Instantly share code, notes, and snippets.

@DarkArc
Last active July 10, 2020 18:26
Show Gist options
  • Save DarkArc/1005d952d14e424cb6b987ab56da4cf3 to your computer and use it in GitHub Desktop.
Save DarkArc/1005d952d14e424cb6b987ab56da4cf3 to your computer and use it in GitHub Desktop.
CPPX Compiler Mono-repo MSVC Build
if (Test-Path "llvm-project") {
Push-Location "llvm-project"
git pull
Pop-Location
} else {
git clone --branch feature/metaprogramming https://github.com/lock3/meta.git llvm-project
}
if (!(Test-Path "build")) {
New-Item -ItemType Directory -Name "build"
Push-Location "build"
cmake --config Release -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi" -G "Visual Studio 15 2017" -A x64 -Thost=x64 -DLLVM_TARGETS_TO_BUILD="X86" ..\llvm-project\llvm
Pop-Location
}

Initial Setup

  1. Make sure you have installed:
    • Python 3
    • Git
    • CMake 3.12 or higher
    • Visual Studio 2015 or higher (tested with 2017)
  2. Place the ClangUpdater.ps1 script in the directory where you want the project to live
  3. Run ClangUpdater.ps1 (sets up the initial directory structure, initial repository clones, and cmake)

After completing these steps, you should get a release build configured LLVM.sln file in <Your Dir>\build that you can feed to MSBuild, or open with Visual Studio.

You can also perform the build with cmake itself (recommended):

cmake --build . --target ALL_BUILD --config Release

Updating Clang

Running under the assumption no files have been locally tweaked, to update to the latest version of the compiler, simply run ClangUpdater.ps1 again, then build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment