move lib2geom build into janet build folder
s-ol
3 years ago
|
0 |
#ifndef JANET_2GEOM_POINT_INCLUDED
|
|
1 |
#define JANET_2GEOM_POINT_INCLUDED
|
|
2 |
|
|
3 |
#include <janet.h>
|
|
4 |
|
|
5 |
#ifdef __cplusplus
|
|
6 |
#include <2geom/point.h>
|
|
7 |
|
|
8 |
Janet janet_wrap_point(Geom::Point const &x);
|
|
9 |
Janet janet_wrap_point(Geom::IntPoint const &x);
|
|
10 |
Geom::Point janet_unwrap_point(Janet x);
|
|
11 |
|
|
12 |
extern "C" {
|
|
13 |
#endif
|
|
14 |
|
|
15 |
extern const JanetAbstractType geom_point_type;
|
|
16 |
|
|
17 |
void janet_lib_geom_point(JanetTable *env);
|
|
18 |
|
|
19 |
#ifdef __cplusplus
|
|
20 |
}
|
|
21 |
#endif
|
|
22 |
|
|
23 |
#endif // JANET_2GEOM_POINT_INCLUDED
|
0 | |
#ifndef JANET_2GEOM_POINT_INCLUDED
|
1 | |
#define JANET_2GEOM_POINT_INCLUDED
|
2 | |
|
3 | |
#include <janet.h>
|
4 | |
|
5 | |
#ifdef __cplusplus
|
6 | |
#include <2geom/point.h>
|
7 | |
|
8 | |
Janet janet_wrap_point(Geom::Point const &x);
|
9 | |
Janet janet_wrap_point(Geom::IntPoint const &x);
|
10 | |
Geom::Point janet_unwrap_point(Janet x);
|
11 | |
|
12 | |
extern "C" {
|
13 | |
#endif
|
14 | |
|
15 | |
extern const JanetAbstractType geom_point_type;
|
16 | |
|
17 | |
void janet_lib_geom_point(JanetTable *env);
|
18 | |
|
19 | |
#ifdef __cplusplus
|
20 | |
}
|
21 | |
#endif
|
22 | |
|
23 | |
#endif // JANET_2GEOM_POINT_INCLUDED
|
9 | 9 |
(def olddir (os/cwd))
|
10 | 10 |
(try
|
11 | 11 |
(do
|
12 | |
(shell "pwd")
|
13 | |
(os/mkdir "lib2geom/build")
|
14 | |
(os/cd "lib2geom/build")
|
15 | |
(shell "cmake" ".." "-DCMAKE_CXX_FLAGS:STRING=-fPIC")
|
|
12 |
(os/mkdir "build/lib2geom")
|
|
13 |
(os/cd "build/lib2geom")
|
|
14 |
(shell "cmake" "../../lib2geom" "-DCMAKE_CXX_FLAGS:STRING=-fPIC")
|
16 | 15 |
(shell "make" "2geom"))
|
17 | 16 |
([err] (print "Error compiling lib2geom.a: " err)))
|
18 | 17 |
(os/cd olddir))
|
19 | |
(add-body "clean"
|
20 | |
(shell "rm" "-rf" "lib2geom/build")
|
21 | |
(print "Deleted lib2geom build directory."))
|
22 | 18 |
|
23 | |
(declare-native :name "geom" :source @["src/point.cpp" "src/main.cpp"]
|
|
19 |
(declare-native :name "geom"
|
|
20 |
:headers @["include/janet_2geom.h"]
|
|
21 |
:source @["src/point.cpp" "src/main.cpp"]
|
24 | 22 |
:compiler "g++"
|
25 | 23 |
:linker "g++"
|
26 | 24 |
:cflags ["-Wall" "-Wextra" "-Iinclude" "-Ilib2geom/src"]
|
27 | |
:lflags ["lib2geom/build/src/2geom/lib2geom.a" "-ldl" "-ldouble-conversion" "-lgsl" "-lgslcblas" "-lm"])
|
|
25 |
:lflags ["build/lib2geom/src/2geom/lib2geom.a" "-ldl" "-ldouble-conversion" "-lgsl" "-lgslcblas" "-lm"])
|
28 | 26 |
|
29 | 27 |
(def- lname (string "build" sep "geom" statext))
|
30 | 28 |
(def- sname (string "build" sep "geom" modext))
|
0 | |
#include "point.h"
|
|
0 |
#include "janet_2geom.h"
|
1 | 1 |
|
2 | 2 |
extern "C" {
|
3 | 3 |
|
0 | |
#include "point.h"
|
|
0 |
#include "janet_2geom.h"
|
1 | 1 |
|
2 | 2 |
#include <sstream>
|
3 | 3 |
|