All Projects → fstudio → clangbuilder

fstudio / clangbuilder

Licence: MIT license
Building Clang ♡ Utility and Environment

Programming Languages

C++
36643 projects - #6 most used programming language
assembly
5116 projects
c
50402 projects - #5 most used programming language
powershell
5483 projects
NASL
115 projects
CMake
9771 projects

Projects that are alternatives of or similar to clangbuilder

llvm-svn
Arch Linux PKGBUILD for LLVM, Clang et al. (latest SVN code)
Stars: ✭ 18 (-82.18%)
Mutual labels:  llvm, clang, lldb
Llvm Vs2017 Integration
MSBuild 15.0 Toolset integration for multiple LLVM (From v5 to v8)
Stars: ✭ 84 (-16.83%)
Mutual labels:  visual-studio, llvm, clang
Swiftweekly.github.io
A community-driven weekly newsletter about Swift.org
Stars: ✭ 305 (+201.98%)
Mutual labels:  llvm, clang, lldb
lldbg
A lightweight native GUI for LLDB.
Stars: ✭ 83 (-17.82%)
Mutual labels:  llvm, clang, lldb
Bsodsurvivor
This project aims to facilitate debugging a kernel driver in windows by adding support for a code change on the fly without reboot/unload, and more!
Stars: ✭ 122 (+20.79%)
Mutual labels:  llvm, clang, lldb
Checkedc
Checked C is an extension to C that lets programmers write C code that is guaranteed by the compiler to be type-safe. The goal is to let people easily make their existing C code type-safe and eliminate entire classes of errors. Checked C does not address use-after-free errors. This repo has a wiki for Checked C, sample code, the specification, a…
Stars: ✭ 2,692 (+2565.35%)
Mutual labels:  llvm, clang
ci playground
Playground for Cloud CI development for C++
Stars: ✭ 23 (-77.23%)
Mutual labels:  visual-studio, clang
Ci helloworld
A simple example of how to setup a complete CI environment for C and C++
Stars: ✭ 357 (+253.47%)
Mutual labels:  visual-studio, clang
Pfr
std::tuple like methods for user defined types without any macro or boilerplate code
Stars: ✭ 896 (+787.13%)
Mutual labels:  visual-studio, clang
Dstep
A tool for converting C and Objective-C headers to D modules
Stars: ✭ 177 (+75.25%)
Mutual labels:  llvm, clang
Croaring
Roaring bitmaps in C (and C++)
Stars: ✭ 735 (+627.72%)
Mutual labels:  visual-studio, clang
TON-Compiler
Clang compiler for Free TON Virtual Machine
Stars: ✭ 56 (-44.55%)
Mutual labels:  llvm, clang
Cmake Scripts
A selection of useful scripts for use in CMake projects, include code coverage, sanitizers, and dependency graph generation.
Stars: ✭ 202 (+100%)
Mutual labels:  llvm, clang
Clang Expand
🐉 A clang tool for happy refactoring without source-code gymnastics
Stars: ✭ 182 (+80.2%)
Mutual labels:  llvm, clang
Boomerang
Boomerang Decompiler - Fighting the code-rot :)
Stars: ✭ 265 (+162.38%)
Mutual labels:  visual-studio, clang
Constexpr Everything
Rewrite C++ code to automatically apply `constexpr` where possible
Stars: ✭ 178 (+76.24%)
Mutual labels:  llvm, clang
FrameOfReference
C++ library to pack and unpack vectors of integers having a small range of values using a technique called Frame of Reference
Stars: ✭ 36 (-64.36%)
Mutual labels:  visual-studio, clang
Vector
➿ A supercharged std::vector implementation (minus Allocator)
Stars: ✭ 118 (+16.83%)
Mutual labels:  visual-studio, clang
Compilescore
Visual Studio extension and standalone app for build times and compilation data visualization.
Stars: ✭ 135 (+33.66%)
Mutual labels:  visual-studio, clang
codebrowser
Woboq CodeBrowser
Stars: ✭ 985 (+875.25%)
Mutual labels:  llvm, clang

Clangbuilder

Automated tools help developers on Windows platforms building LLVM and clang.

Installation

Clone clangbuilder on Github

git clone https://github.com/fstudio/clangbuilder.git clangbuilder

Click the script/InitializeEnv.bat

The installation script will compile ClangbuilderUI and create a shortcut, download required packages.

Settings

Your can modified settings.json to change your clangbuilder run mode. settings.template.json content like here:

{
  "EnterpriseWDK": "D:\\EWDK",
  "LLVMRoot": "D:\\LLVM",
  "LLVMArch": "x64",
  "PwshCoreEnabled": true,
  "UseWindowsTerminal": true,
  "Conhost": "C:\\Path\\To\\OpenConsole.exe",
  "SetWindowCompositionAttribute": false
}
  • EnterpriseWDK Set EWDK root path and enable Enterprise WDK.
  • LLVMRoot Pre-built llvm installation root directory.
  • LLVMArch Pre-built llvm default architecture
  • PwshCoreEnabled Enable Powershell Core, all script run use pwsh (when you install powershell core).
  • UseWindowsTerminal Use Windows Terminal (We need wt support commandline)
  • Conhost If Windows Termianl not exists, your can set OpenConsole path.
  • SetWindowCompositionAttribute Fluent UI features

Build Clang on Windows

Clangbuilder Now Only support use Visual C++ build Clang LLVM LLDB.

Best Visual Studio Version:

Visual Studio 2019 16.3 or later

You can click to run ClangbuilderUI, Modified Arch, Configuration and other options. after click Building

ClangbuilderUI Snapshot

clangbuilder

Branch

CMake Custom flags

You can custom cmake build flags Now !!!

Clangbuilder will check $ClangbuilderRoot\out\cmakeflags.$Branch.json and $ClangbuilderRoot\out\cmakeflags.json is exists, if exists parse cmake flags.

The corresponding branch takes effect:

cmakeflags.mainline.json
cmakeflags.stable.json
cmakeflags.release.json

Set cmakeflags.json will take effect in all branches (Mainline, Stable, Release)

Flags configuration format is json:

{
    "CMake":[
        "-DCMAKE_INSTALL_PREFIX=\"D:/LLVM\""
    ]
}

Engine

  • MSbuild use msbuild build llvm MSBuild - MSVC
  • Ninja use ninja build llvm Ninja - MSVC
  • NinjaBootstrap use ninja build and bootstrap llvm Ninja - Bootstrap
  • NinjaIterate use ninja build llvm, but compile is prebuilt clang (config by config\prebuilt.json) Ninja - Clang

LLDB

When you select build LLDB, If not found Python 3 installed. Clangbuilder add flag -DLLDB_DISABLE_PYTHON=1.

LLDB maybe not work.

Libc++

Only NinjaBootstrap and NinjaIterate will compile libc++ ,Because Visual C++ not support include_next now.

clang-cl -std:c++14  -Iinclude\c++\v1 hello.cc c++.lib

after copy c++.dll to your path(or exe self directory).

Use Clean Environment

Clangbuilder support Clean Environment, When use -ClearEnv flag or enable check box Use Clean Environment, Clangbuilder will retset $env:PATH.

Function ReinitializePath {
    if ($PSEdition -eq "Desktop" -or $IsWindows) {
        $env:PATH += "${env:windir};${env:windir}\System32;${env:windir}\System32\Wbem;${env:windir}\System32\WindowsPowerShell\v1.0"
    }
    else {
        $env:PATH = "/usr/local/bin:/usr/bin:/bin"
    }
}

Windows Terminal

You 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:

termianl

Custom PATH

You can modify config/initialize.json , add some directories to PATH. Note that directories have higher priority in PATH. (Insert Front)

Suggest

  • Best Platform is Windows 10 x64
  • Select Use Clean Environment will reset current process Environment PATH value, Resolve conflict environment variables
  • If your will build lldb, your should install python3.
$env:Path = "${env:windir};${env:windir}\System32;${env:windir}\System32\Wbem;${env:windir}\System32\WindowsPowerShell\v1.0"

$evn:windir is usually C:\Windows

Add Portable Utilities

baulk is a better Windows package management tool developed by the author

You can port some tools to clangbuilder, see ports and 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.

Usage:

devi 7.0 portable package manager
Usage: devi cmd package-name
    list         list installed package
    search       search ported package
    install      install package
    uninstall    uninstall package
    upgrade      upgrade all upgradeable packages
    help         print help message
    version      print devi version and exit

Default installed tools:

{
    "core": [
        "7z",
        "cmake",
        "git",
        "ninja",
        "nsis",
        "nuget",
        "python2",
        "vswhere"
    ]
}

Current ported tools:

7z                  19.00               7-Zip is a file archiver with a high compression ratio
ag                  2019-03-23/2.2....  A code-searching tool similar to ack, but faster.
arc                 3.2                 Introducing Archiver - a cross-platform, multi-format archive utility
aria2               1.35.0              The ultra fast download utility
bat                 v0.12.1             A cat(1) clone with wings.
cmake               3.16.4              CMake is an open-source, cross-platform family of tools designed to build, test and package software
curl                7.68.0              Curl is a command-line tool for transferring data specified with URL syntax.
dmd                 2.090.0             D is a general-purpose programming language with static typing, systems-level access, and C-like syntax
fd                  v7.4.0              A simple, fast and user-friendly alternative to 'find'
git                 2.25.0              Git is a modern distributed version control system focused on speed
hg                  5.3                 Mercurial is a free, distributed source control management tool.
innoextract         1.8                 A tool to unpack installers created by Inno Setup.
innounp             0.49                InnoUnp - Inno Setup Unpacker.
jom                 1.1.3               jom is a clone of nmake
mach2               0.3.0.0             Mach2 manages the Windows Feature Store, where Features (and associated on/off state) live.
nasm                2.14.02             NASM - The Netwide Assembler
neovim              0.4.2               Neovim - Vim-fork focused on extensibility and usability
ninja               1.10.0              Ninja is a small build system with a focus on speed.
nsis                3.05                NSIS (Nullsoft Scriptable Install System) is a professional open source system to create Windows installers.
nuget               5.4.0               NuGet is the package manager for .NET. The NuGet client tools provide the ability to produce and consume packages.
openssh             v8.1.0.0p1-Beta     Portable OpenSSH
perl5               5.30.0.1            Perl 5 is a highly capable, feature-rich programming language.
pijul               0.11.0              Pijul is a free and open source (GPL2) distributed version control system.
putty               0.73                PuTTY: a free SSH and Telnet client.
python3             3.5.4               Python is a programming language.
radare              4.0.0               unix-like reverse engineering framework and commandline tools
ripgrep             11.0.2              ripgrep recursively searches directories for a regex pattern.
shfmt               3.0.1               A shell formatter.
swigwin             4.0.1               Simplified Wrapper and Interface Generator
unrar               5.90                Decompress RAR files.
vswhere             2.8.4               Visual Studio Locator.
watchexec           1.11.1              Execute commands in response to file modifications.
wget                1.20.3              A command-line utility for retrieving files using HTTP, HTTPS and FTP protocols.

Extensions:

We 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.

7z.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

Add Extranl Libs

You can add extranl lib, such as z3, download 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).

About Ninja Task

Ninja Task Parallel:

Function Parallel() {
    $MemSize = (Get-CimInstance -Class Win32_ComputerSystem).TotalPhysicalMemory
    $ProcessorCount = $env:NUMBER_OF_PROCESSORS
    $MemParallelRaw = $MemSize / 1610612736 #1.5GB
    #[int]$MemParallel = [Math]::Floor($MemParallelRaw)
    [int]$MemParallel = [Math]::Ceiling($MemParallelRaw) ## less 1
    return [Math]::Min($ProcessorCount, $MemParallel)
}

Copyright

License: MIT
Author: Force.Charlie
Copyright © 2022 Force Charlie. All Rights Reserved.

Other

fstudio: Icons made by Smashicons from www.flaticon.com
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].