From b69f77d19a8eae5251968bad1703d21ea9b39f9b Mon Sep 17 00:00:00 2001 From: tokomine Date: Mon, 11 Dec 2023 15:47:39 +0800 Subject: add includedirs for swig --- tests/projects/swig/auto_include/src/example.cpp | 14 ++++++++++++++ tests/projects/swig/auto_include/src/example.i | 13 +++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 tests/projects/swig/auto_include/src/example.cpp create mode 100644 tests/projects/swig/auto_include/src/example.i (limited to 'tests/projects/swig/auto_include/src') diff --git a/tests/projects/swig/auto_include/src/example.cpp b/tests/projects/swig/auto_include/src/example.cpp new file mode 100644 index 000000000..b0ddc9c26 --- /dev/null +++ b/tests/projects/swig/auto_include/src/example.cpp @@ -0,0 +1,14 @@ +double My_variable = 3.0; + +/* Compute factorial of n */ +int fact(int n) { + if (n <= 1) + return 1; + else + return n*fact(n-1); +} + +/* Compute n mod m */ +int my_mod(int n, int m) { + return(n % m); +} diff --git a/tests/projects/swig/auto_include/src/example.i b/tests/projects/swig/auto_include/src/example.i new file mode 100644 index 000000000..945b77892 --- /dev/null +++ b/tests/projects/swig/auto_include/src/example.i @@ -0,0 +1,13 @@ +%module example + +%{ +/* Put headers and other declarations here */ +#include "nlohmann/json.hpp" +extern double My_variable; +extern int fact(int); +extern int my_mod(int n, int m); +%} + +extern double My_variable; +extern int fact(int); +extern int my_mod(int n, int m); -- cgit v1.3.1