All Projects → jacob-carlborg → Dstep

jacob-carlborg / Dstep

A tool for converting C and Objective-C headers to D modules

Programming Languages

c
50402 projects - #5 most used programming language
d
599 projects

Projects that are alternatives of or similar to Dstep

Termux Ndk
android-ndk for termux
Stars: ✭ 91 (-48.59%)
Mutual labels:  llvm, clang
Play with llvm
A book about LLVM & Clang(中文开源书:玩转 LLVM)
Stars: ✭ 175 (-1.13%)
Mutual labels:  llvm, clang
Tre
LLVM backed progamming language (Go subset)
Stars: ✭ 100 (-43.5%)
Mutual labels:  llvm, clang
Meta Clang
Clang C/C++ cross compiler and runtime for OpenEmbedded/Yocto Project
Stars: ✭ 76 (-57.06%)
Mutual labels:  llvm, clang
Cling
The cling C++ interpreter
Stars: ✭ 2,322 (+1211.86%)
Mutual labels:  llvm, clang
Codechecker
CodeChecker is an analyzer tooling, defect database and viewer extension for the Clang Static Analyzer and Clang Tidy
Stars: ✭ 1,209 (+583.05%)
Mutual labels:  llvm, clang
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 (-31.07%)
Mutual labels:  llvm, clang
Zapcc
zapcc is a caching C++ compiler based on clang, designed to perform faster compilations
Stars: ✭ 1,109 (+526.55%)
Mutual labels:  llvm, clang
Proton Clang
Proton Clang toolchains builds in the form of a continuously updating Git repository. Clone with --depth=1.
Stars: ✭ 126 (-28.81%)
Mutual labels:  llvm, clang
Metareflect
Metareflect is a lightweight reflection system for C++, based on LLVM and Clangs libtooling.
Stars: ✭ 125 (-29.38%)
Mutual labels:  llvm, clang
Seeless
C IDE for iOS
Stars: ✭ 71 (-59.89%)
Mutual labels:  llvm, clang
Clang Llvm Tutorial
clang & llvm examples, e.g. AST Interpreter, Function Pointer Analysis, Value Range Analysis, Data-Flow Analysis, Andersen Pointer Analysis, LLVM Backend...
Stars: ✭ 139 (-21.47%)
Mutual labels:  llvm, clang
Avalonstudio
Cross platform IDE and Shell
Stars: ✭ 1,132 (+539.55%)
Mutual labels:  llvm, clang
Llvm Vs2017 Integration
MSBuild 15.0 Toolset integration for multiple LLVM (From v5 to v8)
Stars: ✭ 84 (-52.54%)
Mutual labels:  llvm, clang
Optviewer Demo
Demonstration of LLVM's opt-viewer tool
Stars: ✭ 63 (-64.41%)
Mutual labels:  llvm, clang
Cppinsights
C++ Insights - See your source code with the eyes of a compiler
Stars: ✭ 1,382 (+680.79%)
Mutual labels:  llvm, clang
Llvm 9.0 Learner Tutorial
A blog for LLVM(v9.0.0 or v11.0.0) beginner, step by step, with detailed documents and comments. Record the way I learn LLVM and accomplish a complete project for FPGA High-Level Synthesis with it.
Stars: ✭ 58 (-67.23%)
Mutual labels:  llvm, clang
Cxxctp
DEPRECATED. USE INSTEAD github.com/blockspacer/flextool
Stars: ✭ 58 (-67.23%)
Mutual labels:  llvm, clang
Llvm Utils
LLVM/Clang for Visual Studio 2019, 2017, 2015, 2013, 2012 and 2010. clang-cl for Python3 distutils. Utils for Clang Static Analyzer
Stars: ✭ 123 (-30.51%)
Mutual labels:  llvm, clang
Gllvm
Whole Program LLVM: wllvm ported to go
Stars: ✭ 126 (-28.81%)
Mutual labels:  llvm, clang

DStep

DStep is a tool for automatically generating D bindings for C and Objective-C libraries. This is implemented by processing C or Objective-C header files and output D modules. DStep uses the Clang compiler as a library (libclang) to process the header files.

Download

For the latest release see: releases/latest.

Pre-compiled binaries are available for macOS and Linux as 64 bit binaries and Windows as 32 and 64 bit binaries. The Linux binaries are completely statically linked and should work on all distros. The macOS binaries are statically linked against libclang requires no other dependencies than the system libraries. They should work on macOS Mavericks (10.9) and later. The Windows binaries require to install libclang. See the releases section.

Alternatively install via Dub

License

The source code is available under the Boost Software License 1.0

Building

Posix

Requirements

Building

  1. Install all requirements, see above

  2. Clone the repository by running:

     $ git clone https://github.com/jacob-carlborg/dstep
    
  3. Run dub build

A configuration script will try to automatically locate libclang by looking through a couple of default search paths. If libclang is not found in any of the default paths, please manually invoke the configuration script and specify the path to where libclang is installed using the --llvm-path flag.

$ ./configure --llvm-path /usr/lib/llvm-4.0/lib

Windows

Requirements

Building

  1. Install all requirements, see above

  2. Clone the repository by running:

     $ git clone git://github.com/jacob-carlborg/dstep.git
    
  3. Run dub build --arch=x86_mscoff --build=release to build 32-bit version

  4. Run dub build --arch=x86_64 --build=release to build 64-bit version

Remarks

Building 32-bit version requires a 32-bit variant of the Visual Studio toolchain to be present in PATH. The same for 64-bit. Remember to specify --arch=x86_mscoff when building 32-bit version. The architecture specification is mandatory as with the default architecture or --arch=x86 dub will try to use unsupported OPTLINK linker. OPTLINK linker requires unsupported version of libclang binaries. Remember to install LLVM to its default installation path and to add its binaries to the PATH environmental variable (otherwise you may need to change dub.json). When the program compiles under Windows but crashes at start, make sure an appropriate version of libclang.dll is available for DStep (you can validate it easily by copying dll to the directory with DStep). Here you can find more information on the topic.

Usage

$ dstep Foo.h -o Foo.d

For translating Objective-C headers add the -ObjC flag.

$ dstep Foo.h -o Foo.d -ObjC

For translating multiple files at once, simply pass all the files to dstep. In this case though, -o (if given) would point to output directory name. The directory will be created if it doesn't exist.

$ dstep Foo1.h Foo2.h Foo3.h .... FooN.h -o ./outputDirectory/

Use -h for usage information. Any flags recognized by Clang can be used.

Limitations/Known issues

  • Supports translating some of the preprocessor, like: #define for simple constants, function like macros and the token concatenation operator (##)

  • Doesn't translate #include to import. Imports for a few standard C headers are added automatically

  • Doesn't translate C++ at all

  • Umbrella headers. Some headers just serve to include other headers. If these other headers contain some form of protection, like #error, to be included directly this can cause problems for DStep

  • Some headers are designed to always be included together with other header files. These headers may very well use symbols from other header files without including them itself. Since DStep is designed to convert header files one-by-one this doesn't work. There are two workarounds for this:

    1. Add #include-directives for the header files the header file is actually using
    2. Use the -include <file> flag available in Clang to indicate the given <file> should be processed before the file that should be translated. DStep accepts all flags Clang accepts
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].