https://github.com/ikvmnet/ikvm-clang
Tools for building applications with Clang
https://github.com/ikvmnet/ikvm-clang
Last synced: 12 days ago
JSON representation
Tools for building applications with Clang
- Host: GitHub
- URL: https://github.com/ikvmnet/ikvm-clang
- Owner: ikvmnet
- License: mit
- Created: 2023-05-12T00:50:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2026-05-29T00:02:37.000Z (12 days ago)
- Last Synced: 2026-05-29T00:10:46.797Z (12 days ago)
- Language: C#
- Size: 187 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# IKVM.Clang
**MSBuild SDK and Visual Studio extension for building native projects with the Clang compiler.**
[](https://www.nuget.org/packages/IKVM.Clang.Sdk)
[](https://marketplace.visualstudio.com/items?itemName=IKVM.IKVM.Clang)
[](LICENSE)
---
## Overview
IKVM.Clang provides two components:
| Component | Description |
|-----------|-------------|
| **`IKVM.Clang.Sdk`** | MSBuild SDK that drives `clang` / `llvm-ar` to compile C, C++, Objective-C, and assembly source files into executables, shared libraries, or static libraries. Works on Windows, Linux, and macOS from the command line or CI. |
| **IKVM.Clang VSIX** | Visual Studio extension that integrates the SDK with the IDE: CPS-based project system, Solution Explorer icons, syntax highlighting for C/C++/Objective-C/Assembly, and property pages. |
---
## Requirements
- [LLVM / Clang](https://releases.llvm.org/) installed and `clang` / `llvm-ar` on `PATH` (or configured via MSBuild properties)
- .NET SDK (for MSBuild) — .NET 6 or later recommended
- Visual Studio 2022 17.0+ (for the VSIX extension, optional)
---
## Getting Started
### 1 — Install the Visual Studio Extension (optional)
If you are using Visual Studio, install the **IKVM.Clang** extension from the Visual Studio Marketplace. When you open a project that uses `IKVM.Clang.Sdk`, Visual Studio will offer to install the extension automatically if it is not already present.
### 2 — Create a project
Add the SDK to your project file (`.clangproj` or any MSBuild project extension):
```xml
x86_64-pc-windows-msvc
exe
```
### 3 — Build
```shell
dotnet build
```
or from Visual Studio: **Build → Build Solution**.
---
## Supported Source File Types
| Item Type | Extensions |
|-----------|------------|
| C source | `.c` |
| C++ source | `.cpp` `.cc` `.cxx` `.c++` `.cppm` `.ixx` |
| C/C++ header | `.h` `.hpp` `.hh` `.hxx` `.h++` `.ipp` |
| Objective-C / Objective-C++ | `.m` `.mm` |
| Assembly | `.s` `.asm` |
---
## Output Types
| `OutputType` | Description | Output |
|---|---|---|
| `exe` | Executable | `.exe` / *(no extension)* / `.wasm` |
| `dll` | Shared library | `.dll` / `.so` / `.dylib` |
| `lib` | Static library | `.lib` / `.a` |
---
## Key MSBuild Properties
| Property | Default | Description |
|----------|---------|-------------|
| `TargetIdentifiers` | *(required)* | Semicolon-separated LLVM target triples, e.g. `x86_64-pc-windows-msvc` |
| `OutputType` | `dll` | Output kind: `exe`, `dll`, or `lib` |
| `ClangToolExe` | `clang` / `clang.exe` | Path or name of the Clang executable |
| `LlvmArToolExe` | `llvm-ar` / `llvm-ar.exe` | Path or name of the LLVM archiver |
| `DebugSymbols` | `true` in Debug | Emit debug symbols |
| `UseLd` | `lld` | Linker driver (`lld`, `bfd`, `gold`, etc.) |
---
## Repository Structure
```
src/
IKVM.Clang.Sdk/ MSBuild SDK package (targets, props, CPS rules)
IKVM.Clang.Sdk.Tasks/ Custom MSBuild tasks
IKVM.Clang.Vsix/ Visual Studio extension (VSIX)
samples/
IKVM.Clang.Sample1/ Minimal C project example
```
---
## Contributing
Pull requests are welcome. Please open an issue first to discuss significant changes.
## License
This project is licensed under the [MIT License](LICENSE).