Skip to content

Commit

Permalink
Adjust cbindgen Overrides for CFFI (#1957)
Browse files Browse the repository at this point in the history
* Adjust cbindgen overrides

* Phrasing

---------

Co-authored-by: konsti <konstin@mailbox.org>
  • Loading branch information
nhusung and konstin committed Feb 29, 2024
1 parent 14a7b2d commit d4e881e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/module_writer.rs
Expand Up @@ -544,18 +544,24 @@ fn cffi_header(crate_dir: &Path, target_dir: &Path, tempdir: &TempDir) -> Result
} else {
if crate_dir.join("cbindgen.toml").is_file() {
eprintln!(
"💼 Using the existing cbindgen.toml configuration. \n\
💼 Enforcing the following settings: \n \
"💼 Using the existing cbindgen.toml configuration.\n\
💼 Enforcing the following settings:\n \
- language = \"C\" \n \
- no_includes = true \n \
- no include_guard \t (directives are not yet supported) \n \
- no defines \t (directives are not yet supported)"
- no_includes = true, sys_includes = []\n \
(#include is not yet supported by CFFI)\n \
- defines = [], include_guard = None, pragma_once = false, cpp_compat = false\n \
(#define, #ifdef, etc. is not yet supported by CFFI)\n"
);
}

let mut config = cbindgen::Config::from_root_or_default(crate_dir);
config.language = cbindgen::Language::C;
config.no_includes = true;
config.sys_includes = Vec::new();
config.defines = HashMap::new();
config.include_guard = None;
config.pragma_once = false;
config.cpp_compat = false;

let bindings = cbindgen::Builder::new()
.with_config(config)
Expand Down

0 comments on commit d4e881e

Please sign in to comment.