Skip to content
/ b2 Public

b² is a jinja-inspired template engine which uses LLVM to generate native code

License

Notifications You must be signed in to change notification settings

mcuelenaere/b2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

b² is a jinja-inspired template engine which uses LLVM to generate native code.

Building the code

Mac OS X

Requirements:

  • brew install cmake
  • brew install llvm
  • brew install bison

Build steps:

mkdir build && cd build
cmake .. -DBISON_EXECUTABLE=/usr/local/opt/bison/bin/bison -DLLVM_CONFIG_EXECUTABLE=/usr/local/opt/llvm/bin/llvm-config
make
make install

Linux

Requirements:

  • aptitude install cmake
  • aptitude install llvm

TODO

Running tests

tests/runner.py build/

Generate Xcode project

mkdir xcode && cd xcode
cmake .. -G Xcode
open b2.xcodeproj/

Unofficial Homebrew formula

require 'formula'

class B2 < Formula
  head 'https://github.com/mcuelenaere/b2'
  version '0.0.1'

  option 'with-php-bindings', 'Enable PHP bindings.'

  depends_on 'cmake' => :build
  depends_on 'bison' => :build

  # Standard packages
  depends_on 'llvm'
  depends_on 'php55' if build.with? 'php-bindings'

  def install
    args = [
      "-DBISON_EXECUTABLE=#{Formula['bison'].opt_prefix}/bin/bison",
      "-DLLVM_CONFIG_EXECUTABLE=#{Formula['llvm'].opt_prefix}/bin/llvm-config"
    ] + std_cmake_args

    if build.with? 'php-bindings'
      args << "-DPHP_CONFIG_EXECUTABLE=#{Formula['php55'].opt_prefix}/bin/php-config"
    end

    mkdir "build"
    cd "build" do
      system "cmake", "..", *args
      system "make"
      system "make install"
    end

    if build.with? 'php-bindings'
      # TODO: install php.ini
    end
  end
end

About

b² is a jinja-inspired template engine which uses LLVM to generate native code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published