/rules_gambit

Gambit Scheme rules for Bazel

Primary LanguagePython

Gambit Scheme Rules for Bazel

Build Status

Rules

Overview

Bazel rules for with Gambit Scheme

Setup

To be able to use the Gambit Scheme rules, add following to your WORKSPACE file.

git_repository(
    name = "bazel_rules_gambit",
    remote = "https://github.com/wsxiaoys/rules_gambit.git",
    tag = "0.0.1",
)
load("@bazel_rules_gambit//gambit:gambit.bzl", "gambit_repositories")

gambit_repositories()

gambit_library

gambit_library(name, srcs, hdrs, deps, cdeps, *args, **kwargs)

gambit_library defines two build target:

  • name: Static linked library. Underlying it's a cc_library target thus can be linked to any c libs / binaries.
  • name.o1: Dynamic linked library. Can be used in gsc/gsi with load primitive.
Attributes Description
name String, required

A unique name for this rule.

srcs List of Labels

List of .scm source files used to build the library.

They are converted into c source code and compiled with cc_library

hdrs List of Labels

List of .scm source files used by rules depends on it at compiling time.

Rules depend on the library will have access to these files at compiling time.. Usually they're macros, library definitions or just files to be included.

deps List of Labels

List of other libraries to be used when compiling / linking

  • Compile: Direct dependencies' hdrs will be accessible.
  • Link: Transitive dependencies' output will be linked.
cdeps List of Labels

List of other c libraries to be linked.

*args, **kwargs

Passed to underlying cc_library

gambit_binary

gambit_binary(name, srcs, hdrs, deps, cdeps, *args, **kwargs)
Attributes Description
name String, required

A unique name for this rule.

srcs List of Labels

List of .scm source files used to build the library.

They are converted into c source code and compiled with cc_library

hdrs List of Labels

List of .scm source files used by rules depends on it at compiling time.

Rules depend on the library will have access to these files at compiling time.. Usually they're macros, library definitions or just files to be included.

deps List of Labels

List of other libraries to be used when compiling / linking

  • Compile: Direct dependencies' hdrs will be accessible.
  • Link: Transitive dependencies' output will be linked.
cdeps List of Labels

List of other c libraries to be linked.

*args, **kwargs

Passed to underlying cc_binary