feat: nix-c-raw: Generate value api bindings
(cherry picked from commit 3c75dea63233670863f30547f90dd71498d547b0)
This commit is contained in:
parent
270ccaaa57
commit
0d7146cb39
3 changed files with 10 additions and 0 deletions
|
|
@ -49,6 +49,8 @@
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
config.packages.nix
|
config.packages.nix
|
||||||
];
|
];
|
||||||
|
# Workaround: the gcc in the devshell doesn't find libc headers
|
||||||
|
RUST_NIX_C_RAW_EXTRA_CFLAGS = "-I${pkgs.stdenv.cc.libc.dev}/include";
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkgs.rust-analyzer
|
pkgs.rust-analyzer
|
||||||
pkgs.nixpkgs-fmt
|
pkgs.nixpkgs-fmt
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,13 @@ fn c_headers() -> Vec<String> {
|
||||||
{
|
{
|
||||||
args.push(format!("-I{}", path.to_str().unwrap()));
|
args.push(format!("-I{}", path.to_str().unwrap()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Ok(cflags) = std::env::var("RUST_NIX_C_RAW_EXTRA_CFLAGS") {
|
||||||
|
for flag in cflags.split_whitespace() {
|
||||||
|
args.push(flag.to_string());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// write to stderr for debugging
|
// write to stderr for debugging
|
||||||
eprintln!("c_headers: {:?}", args);
|
eprintln!("c_headers: {:?}", args);
|
||||||
args
|
args
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
#include <nix_api_util.h>
|
#include <nix_api_util.h>
|
||||||
#include <nix_api_store.h>
|
#include <nix_api_store.h>
|
||||||
#include <nix_api_expr.h>
|
#include <nix_api_expr.h>
|
||||||
|
#include <nix_api_value.h>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue