From d64f974348e07ebcbb398ff9047f0e0c3022aea8 Mon Sep 17 00:00:00 2001 From: Bartek Kryza Date: Sat, 7 Jan 2023 17:48:27 +0000 Subject: [PATCH] Updated README --- CHANGELOG.md | 2 ++ README.md | 1 + docs/installation.md | 34 +++++++++++++++++++++++++++------- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c8aeaa5..b93cf941 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # CHANGELOG + * Added support for building with Microsoft Visual Studio + ### 0.3.0 * Added support for sequence diagrams with template code diff --git a/README.md b/README.md index 9438789f..fa7372d1 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ Nowadays, this file can be generated rather easily using multiple methods: * For Boost-based projects try [commands_to_compilation_database](https://github.com/tee3/commands_to_compilation_database) * For SCons, invoke `compilation_db` tool (requires SCons > 4.0.0) +* For Microsoft Visual Studio projects try [Clang Power Tools](https://www.clangpowertools.com) ### Invocation diff --git a/docs/installation.md b/docs/installation.md index 57ccd870..56acca9a 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -81,11 +81,13 @@ First, install the following dependencies manually: * [Git](https://git-scm.com/download/win) * [CMake](https://cmake.org/download/) * [Visual Studio](https://visualstudio.microsoft.com/vs/community/) -* [Clang Power Tools](https://clangpowertools.com/) - this can be installed from VS Extension manager + +> All the following steps should be invoked in `Developer PowerShell for VS`. Create installation directory for `clang-uml` and its dependencies: + ```bash -# This is where our working clang-uml binary will be located +# This is where clang-uml binary and its dependencies will be installed after build # If you change this path, adapt all consecutive steps mkdir C:\clang-uml # This directory will be removed after build @@ -93,7 +95,7 @@ mkdir C:\clang-uml-tmp cd C:\clang-uml-tmp ``` -Build and install yaml-cpp: +Build and install `yaml-cpp`: ```bash git clone https://github.com/jbeder/yaml-cpp @@ -105,18 +107,36 @@ cd yaml-cpp-build msbuild .\INSTALL.sln -maxcpucount /p:Configuration=Release ``` -Build and install LLVM: +Build and install `LLVM`: ```bash pip install psutil -git clone --branch llvmorg-15.0.6 --depth 1 https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-15.0.6.zip +# Update the LLVM branch if necessary +git clone --branch llvmorg-15.0.6 --depth 1 https://github.com/llvm/llvm-project.git llvm cmake -S .\llvm\llvm -B llvm-build -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_INSTALL_PREFIX="C:\clang-uml" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -Thost=x64 -msbuild .\INSTALL.sln -maxcpucount /p:Configuration=Release +cd llvm-build +msbuild .\INSTALL.sln -maxcpucount /p:Configuration=Release ``` -Build and install clang-uml: +Build and install `clang-uml`: ```bash git clone https://github.com/bkryza/clang-uml cmake -S .\clang-uml\ -B .\clang-uml-build\ -DCMAKE_PREFIX_PATH="C:\clang-uml" -Thost=x64 +cd clang-uml-build +msbuild .\INSTALL.sln -maxcpucount /p:Configuration=Release +``` + +Check if `clang-uml` works: + +```bash +cd C:\clang-uml +bin\clang-uml.exe --version +``` +It should produce something like: +```bash +clang-uml 0.3.0 +Copyright (C) 2021-2023 Bartek Kryza +Built against LLVM/Clang libraries version: 15.0.6 +Using LLVM/Clang libraries version: clang version 15.0.6 (https://github.com/llvm/llvm-project.git 088f33605d8a61ff519c580a71b1dd57d16a03f8) ```