{"id":13831344,"url":"https://github.com/fstudio/clangbuilder","last_synced_at":"2025-07-09T13:33:35.508Z","repository":{"id":34270208,"uuid":"38156747","full_name":"fstudio/clangbuilder","owner":"fstudio","description":"Building Clang ♡ Utility and Environment","archived":false,"fork":false,"pushed_at":"2022-09-03T15:27:02.000Z","size":11234,"stargazers_count":104,"open_issues_count":0,"forks_count":14,"subscribers_count":13,"default_branch":"master","last_synced_at":"2024-11-20T12:48:49.839Z","etag":null,"topics":["clang","lldb","llvm","powershell","visual-studio","visualcpp"],"latest_commit_sha":null,"homepage":"https://fstudio.github.io/clangbuilder/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fstudio.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-27T10:49:11.000Z","updated_at":"2024-05-14T04:52:24.000Z","dependencies_parsed_at":"2023-01-15T05:48:23.642Z","dependency_job_id":null,"html_url":"https://github.com/fstudio/clangbuilder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fstudio/clangbuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fstudio%2Fclangbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fstudio%2Fclangbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fstudio%2Fclangbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fstudio%2Fclangbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fstudio","download_url":"https://codeload.github.com/fstudio/clangbuilder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fstudio%2Fclangbuilder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264468215,"owners_count":23613059,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["clang","lldb","llvm","powershell","visual-studio","visualcpp"],"created_at":"2024-08-04T10:01:25.260Z","updated_at":"2025-07-09T13:33:33.935Z","avatar_url":"https://github.com/fstudio.png","language":"C++","readme":"# Clangbuilder\n\n\u003ca href=\"LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/fstudio/clangbuilder.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://996.icu\"\u003e\u003cimg src=\"https://img.shields.io/badge/link-996.icu-red.svg\"\u003e\u003c/a\u003e\n\nAutomated tools help developers on Windows platforms building LLVM and clang.\n\n## Installation\n\nClone clangbuilder on Github\n\n```shell\ngit clone https://github.com/fstudio/clangbuilder.git clangbuilder\n```\n\nClick the `script/InitializeEnv.bat`\n\nThe installation script will compile ClangbuilderUI and create a shortcut, download required packages.\n\n## Settings\n\nYour can modified settings.json to change your clangbuilder run mode. `settings.template.json` content like here:\n\n```json\n{\n  \"EnterpriseWDK\": \"D:\\\\EWDK\",\n  \"LLVMRoot\": \"D:\\\\LLVM\",\n  \"LLVMArch\": \"x64\",\n  \"PwshCoreEnabled\": true,\n  \"UseWindowsTerminal\": true,\n  \"Conhost\": \"C:\\\\Path\\\\To\\\\OpenConsole.exe\",\n  \"SetWindowCompositionAttribute\": false\n}\n```\n\n+   `EnterpriseWDK` Set EWDK root path and enable Enterprise WDK.\n+   `LLVMRoot` Pre-built llvm installation root directory.\n+   `LLVMArch` Pre-built llvm default architecture\n+   `PwshCoreEnabled` Enable Powershell Core, all script run use pwsh (when you install powershell core).\n+   `UseWindowsTerminal` Use Windows Terminal (We need wt support commandline)\n+   `Conhost` If Windows Termianl not exists, your can set OpenConsole path.\n+   `SetWindowCompositionAttribute` Fluent UI features\n\n\n## Build Clang on Windows\n\nClangbuilder Now Only support use Visual C++ build Clang LLVM LLDB.\n\nBest Visual Studio Version:\n\n\u003eVisual Studio 2019 16.3 or later\n\nYou can click to run ClangbuilderUI, Modified Arch, Configuration and other options. after click `Building`\n\n**ClangbuilderUI Snapshot**\n\n![clangbuilder](./docs/images/cbui.png)\n\n**Branch**\n\n+   Mainline, master/trunk branch , git fetch from [https://github.com/llvm-mirror/](https://github.com/llvm-mirror/)\n+   Stable, llvm stable branch, like release_80, git fetch from [https://github.com/llvm-mirror/](https://github.com/llvm-mirror/)\n+   Release, llvm release tag, download for [https://releases.llvm.org/](https://releases.llvm.org/)\n\n\n**CMake Custom flags**\n\nYou can custom cmake build flags Now !!!\n\nClangbuilder will check `$ClangbuilderRoot\\out\\cmakeflags.$Branch.json` and `$ClangbuilderRoot\\out\\cmakeflags.json` is exists, if exists parse cmake flags.\n\nThe corresponding branch takes effect:\n\n```txt\ncmakeflags.mainline.json\ncmakeflags.stable.json\ncmakeflags.release.json\n```\n\nSet `cmakeflags.json` will take effect in all branches (Mainline, Stable, Release)\n\nFlags configuration format is json:\n\n```json\n{\n    \"CMake\":[\n        \"-DCMAKE_INSTALL_PREFIX=\\\"D:/LLVM\\\"\"\n    ]\n}\n```\n\n**Engine**\n\n+   MSbuild use msbuild build llvm `MSBuild - MSVC`\n+   Ninja use ninja build llvm `Ninja - MSVC`\n+   NinjaBootstrap use ninja build and bootstrap llvm `Ninja - Bootstrap`\n+   NinjaIterate use ninja build llvm, but compile is prebuilt clang (config by `config\\prebuilt.json`) `Ninja - Clang`\n\n**LLDB**\n\nWhen you select build LLDB, If not found Python 3 installed. Clangbuilder add flag `-DLLDB_DISABLE_PYTHON=1`.\n\nLLDB maybe not work.\n\n**Libc++**\n\nOnly NinjaBootstrap and NinjaIterate will compile libc++ ,Because Visual C++ not support `include_next` now.\n\n```powershell\nclang-cl -std:c++14  -Iinclude\\c++\\v1 hello.cc c++.lib\n```\n\nafter copy `c++.dll` to your path(or exe self directory).\n\n**Use Clean Environment**\n\nClangbuilder support `Clean Environment`, When use `-ClearEnv` flag or enable check box `Use Clean Environment`, Clangbuilder will retset `$env:PATH`.\n\n```powershell\nFunction ReinitializePath {\n    if ($PSEdition -eq \"Desktop\" -or $IsWindows) {\n        $env:PATH += \"${env:windir};${env:windir}\\System32;${env:windir}\\System32\\Wbem;${env:windir}\\System32\\WindowsPowerShell\\v1.0\"\n    }\n    else {\n        $env:PATH = \"/usr/local/bin:/usr/bin:/bin\"\n    }\n}\n\n```\n\n## Windows Terminal\n\nYou can modify `UseWindowsTerminal` to enable or disable the use of Windows Terminal as the default terminal. When `UseWindowsTerminal` is set to true, you open the Clangbuilder terminal environment, the screenshot is as follows:\n\n\n![termianl](./docs/images/terminal.png)\n\n## Custom PATH\n\nYou can modify [config/initialize.json](./config/initialize.json) , add some directories to PATH. Note that directories have **higher priority** in PATH. (Insert Front)\n\n\n## Suggest\n\n+   Best Platform is Windows 10 x64\n+   Select `Use Clean Environment` will reset current process Environment PATH value, Resolve conflict environment variables\n+   If your will build lldb, your should install python3.\n\n```powershell\n$env:Path = \"${env:windir};${env:windir}\\System32;${env:windir}\\System32\\Wbem;${env:windir}\\System32\\WindowsPowerShell\\v1.0\"\n```\n`$evn:windir` is usually `C:\\Windows`\n\n\n## Add Portable Utilities\n\n**[baulk](https://github.com/baulk/baulk) is a better Windows package management tool developed by the author**\n\nYou can port some tools to clangbuilder, see `ports`\nand then double-click `script/DevAll.bat` to the software you need as part of the Clangbuilder is added to the environment. Clangbuilder 6.0 support `devi`, You can run devi under `Environment Console`, use `devi install $ToolName` to install your need tools.\n\nUsage:\n\n```txt\ndevi 7.0 portable package manager\nUsage: devi cmd package-name\n    list         list installed package\n    search       search ported package\n    install      install package\n    uninstall    uninstall package\n    upgrade      upgrade all upgradeable packages\n    help         print help message\n    version      print devi version and exit\n```\n\nDefault installed tools:\n\n```json\n{\n    \"core\": [\n        \"7z\",\n        \"cmake\",\n        \"git\",\n        \"ninja\",\n        \"nsis\",\n        \"nuget\",\n        \"python2\",\n        \"vswhere\"\n    ]\n}\n```\n\nCurrent ported tools:\n\n```txt\n7z                  19.00               7-Zip is a file archiver with a high compression ratio\nag                  2019-03-23/2.2....  A code-searching tool similar to ack, but faster.\narc                 3.2                 Introducing Archiver - a cross-platform, multi-format archive utility\naria2               1.35.0              The ultra fast download utility\nbat                 v0.12.1             A cat(1) clone with wings.\ncmake               3.16.4              CMake is an open-source, cross-platform family of tools designed to build, test and package software\ncurl                7.68.0              Curl is a command-line tool for transferring data specified with URL syntax.\ndmd                 2.090.0             D is a general-purpose programming language with static typing, systems-level access, and C-like syntax\nfd                  v7.4.0              A simple, fast and user-friendly alternative to 'find'\ngit                 2.25.0              Git is a modern distributed version control system focused on speed\nhg                  5.3                 Mercurial is a free, distributed source control management tool.\ninnoextract         1.8                 A tool to unpack installers created by Inno Setup.\ninnounp             0.49                InnoUnp - Inno Setup Unpacker.\njom                 1.1.3               jom is a clone of nmake\nmach2               0.3.0.0             Mach2 manages the Windows Feature Store, where Features (and associated on/off state) live.\nnasm                2.14.02             NASM - The Netwide Assembler\nneovim              0.4.2               Neovim - Vim-fork focused on extensibility and usability\nninja               1.10.0              Ninja is a small build system with a focus on speed.\nnsis                3.05                NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers.\nnuget               5.4.0               NuGet is the package manager for .NET. The NuGet client tools provide the ability to produce and consume packages.\nopenssh             v8.1.0.0p1-Beta     Portable OpenSSH\nperl5               5.30.0.1            Perl 5 is a highly capable, feature-rich programming language.\npijul               0.11.0              Pijul is a free and open source (GPL2) distributed version control system.\nputty               0.73                PuTTY: a free SSH and Telnet client.\npython3             3.5.4               Python is a programming language.\nradare              4.0.0               unix-like reverse engineering framework and commandline tools\nripgrep             11.0.2              ripgrep recursively searches directories for a regex pattern.\nshfmt               3.0.1               A shell formatter.\nswigwin             4.0.1               Simplified Wrapper and Interface Generator\nunrar               5.90                Decompress RAR files.\nvswhere             2.8.4               Visual Studio Locator.\nwatchexec           1.11.1              Execute commands in response to file modifications.\nwget                1.20.3              A command-line utility for retrieving files using HTTP, HTTPS and FTP protocols.\n```\n\n**Extensions**:\n\nWe support 4 extensions: `exe`, `zip`, `msi`, `7z`. If 7z is not installed, only the first three extensions are supported. If you need to port a 7z extension type of package, you need to understand the decompression format supported by 7z.exe.\n\n\u003e7z.exe supported formats(Unpacking): AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z\n\n\n\n\n## Add Extranl Libs\n\nYou can add extranl lib, such as [z3](https://github.com/Z3Prover/z3),\ndownload extranl lib, unpack to `bin/external` , `bin/external/include` is include dir, `bin/external/lib/$arch(x86,x64,arm,arm64)`, `bin/external/bin/$arch(x86,x64,arm,arm64)`.\n\n## About Ninja Task\n\n**Ninja Task Parallel:**\n\n```powershell\nFunction Parallel() {\n    $MemSize = (Get-CimInstance -Class Win32_ComputerSystem).TotalPhysicalMemory\n    $ProcessorCount = $env:NUMBER_OF_PROCESSORS\n    $MemParallelRaw = $MemSize / 1610612736 #1.5GB\n    #[int]$MemParallel = [Math]::Floor($MemParallelRaw)\n    [int]$MemParallel = [Math]::Ceiling($MemParallelRaw) ## less 1\n    return [Math]::Min($ProcessorCount, $MemParallel)\n}\n```\n\n## Copyright\n\nLicense: MIT  \nAuthor: Force.Charlie  \nCopyright © 2022 Force Charlie. All Rights Reserved.\n\n## Other\n\n\u003cdiv\u003efstudio: Icons made by \u003ca href=\"https://www.flaticon.com/\u003c?=_('authors/')?\u003esmashicons\" title=\"Smashicons\"\u003eSmashicons\u003c/a\u003e from \u003ca href=\"https://www.flaticon.com/\" title=\"Flaticon\"\u003ewww.flaticon.com\u003c/a\u003e\u003c/div\u003e","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffstudio%2Fclangbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffstudio%2Fclangbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffstudio%2Fclangbuilder/lists"}