From 620646d0da2bd8c9b725f412d4496a4eb2e23956 Mon Sep 17 00:00:00 2001 From: Lej77 <31554212+Lej77@users.noreply.github.com> Date: Sat, 14 Sep 2024 22:21:12 +0200 Subject: [PATCH] chore: setup cbindgen to generate C Header Inspired by PR at: https://github.com/Ciantic/VirtualDesktopAccessor/pull/54 --- .gitignore | 3 +++ dll/cbindgen.toml | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 dll/cbindgen.toml diff --git a/.gitignore b/.gitignore index 62520f0..3660220 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,7 @@ /examples +# cbindgen generated header file: +VirtualDesktopAccessor.h + _* \ No newline at end of file diff --git a/dll/cbindgen.toml b/dll/cbindgen.toml new file mode 100644 index 0000000..8ba70bc --- /dev/null +++ b/dll/cbindgen.toml @@ -0,0 +1,47 @@ +# See https://github.com/eqrion/cbindgen/blob/master/docs.md#cbindgentoml +# for detailed documentation of every option here. + +# Initial version of this file is from https://github.com/Ciantic/VirtualDesktopAccessor/pull/54 +# Use this config to generate a C header by: +# - Installing cbindgen: cargo install cbindgen +# - Running it inside the "dll" folder: cbindgen --config cbindgen.toml --crate dll --output VirtualDesktopAccessor.h + +language = "C++" + +############## Options for Wrapping the Contents of the Header ################# + +# header = "/* Text to put at the beginning of the generated file. Probably a license. */" +# trailer = "/* Text to put at the end of the generated file */" +include_guard = "VirtualDesktopAccessor_h" +#pragma_once = true +autogen_warning = "/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */" +include_version = true +namespace = "VirtualDesktopAccessor" +sys_includes = ["cstdint", "Windows.h"] +includes = [] +no_includes = true +after_includes = "" + +documentation_length = "short" +line_endings = "CRLF" # also "CR", "CRLF", "Native" + +style = "both" +cpp_compat = true + +[defines] + +[export] +include = [] +exclude = ["Lazy", "HWND", "GUID"] + +[fn] +prefix = "__declspec(dllimport)" + +[parse] +parse_deps = false +clean = true + +[parse.expand] +all_features = true +default_features = true +features = [] \ No newline at end of file