Skip to content

Commit

Permalink
Change output directory of cbindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
gaviny82 committed Jul 4, 2023
1 parent 9432ef1 commit 9061495
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ add_custom_target(
COMMAND cargo build ${clarabel_c_build_flags}
COMMAND cargo install cbindgen --version 0.24.5
# Generate the C header
COMMAND cbindgen --config cbindgen.toml --crate clarabel_c --output ../include/clarabel.h --lang c
COMMAND cbindgen --config cbindgen.toml --crate clarabel_c --output ./headers/clarabel.h --lang c
# Generate the C++ header
COMMAND cbindgen --config cbindgen.toml --crate clarabel_c --output ../include/clarabel.hpp
COMMAND cbindgen --config cbindgen.toml --crate clarabel_c --output ./headers/clarabel.hpp
)

# Get the path to the Rust library for linking
Expand Down
4 changes: 0 additions & 4 deletions include/clarabel.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef CLARABEL_H
#define CLARABEL_H

/* Generated with cbindgen:0.24.5 */

/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
Expand Down
4 changes: 0 additions & 4 deletions include/clarabel.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#ifndef CLARABEL_H
#define CLARABEL_H

/* Generated with cbindgen:0.24.5 */

/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */

#include <cstdarg>
#include <cstdint>
#include <cstdlib>
Expand Down
23 changes: 23 additions & 0 deletions rust_wrapper/headers/clarabel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#ifndef CLARABEL_H
#define CLARABEL_H

/* Generated with cbindgen:0.24.5 */

/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef void CscMatrixF64;

CscMatrixF64 *CscMatrix_new(uintptr_t m,
uintptr_t n,
const uintptr_t *colptr,
const uintptr_t *rowval,
const double *nzval);

void CscMatrix_delete(CscMatrixF64 *ptr);

#endif /* CLARABEL_H */
32 changes: 32 additions & 0 deletions rust_wrapper/headers/clarabel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#ifndef CLARABEL_H
#define CLARABEL_H

/* Generated with cbindgen:0.24.5 */

/* Warning, this file is autogenerated by cbindgen. Don't modify this manually. */

#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <ostream>
#include <new>

namespace clarabel {

using CscMatrixF64 = void;

extern "C" {

CscMatrixF64 *CscMatrix_new(uintptr_t m,
uintptr_t n,
const uintptr_t *colptr,
const uintptr_t *rowval,
const double *nzval);

void CscMatrix_delete(CscMatrixF64 *ptr);

} // extern "C"

} // namespace clarabel

#endif // CLARABEL_H

0 comments on commit 9061495

Please sign in to comment.