git.s-ol.nu janet-2geom / 2626b5f
better jpm build s-ol 2 years ago
1 changed file(s) with 29 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
0 (declare-project :name "geom")
0 (declare-project :name "geom"
1 :dependencies ["https://github.com/joy-framework/tester"])
12
2 (os/shell (string/join [
3 "mkdir" "-p" "lib2geom/build" "&&"
4 "cd" "lib2geom/build" "&&"
5 "cmake" ".." "-D2GEOM_BUILD_SHARED:BOOL=ON" "&&"
6 "make" "2geom"] " "))
3 (def- is-win (= (os/which) :windows))
4 (def- sep (if is-win "\\" "/"))
5 (def- modext (if is-win ".dll" ".so"))
6 (def- statext (if is-win ".static.lib" ".a"))
7
8 (rule "lib2geom.a" []
9 (def olddir (os/cwd))
10 (try
11 (do
12 (shell "pwd")
13 (os/mkdir "lib2geom/build")
14 (os/cd "lib2geom/build")
15 (shell "cmake" ".." "-DCMAKE_CXX_FLAGS:STRING=-fPIC")
16 (shell "make" "2geom"))
17 ([err] (print "Error compiling lib2geom.a: " err)))
18 (os/cd olddir))
19 (add-body "clean"
20 (shell "rm" "-rf" "lib2geom/build")
21 (print "Deleted lib2geom build directory."))
22
723 (declare-native :name "geom" :source @["src/point.cpp" "src/main.cpp"]
824 :compiler "g++"
925 :linker "g++"
10 :cflags ["-Wall" "-Wextra" "-Iinclude" "-Ilib2geom/src" "-Llib2geom/build/src/2geom"]
11 :lflags ["-l2geom" "-ldl" "-ldouble-conversion" "-lgsl" "-lgslcblas" "-lm"])
26 :cflags ["-Wall" "-Wextra" "-Iinclude" "-Ilib2geom/src"]
27 :lflags ["lib2geom/build/src/2geom/lib2geom.a" "-ldl" "-ldouble-conversion" "-lgsl" "-lgslcblas" "-lm"])
28
29 (def- lname (string "build" sep "geom" statext))
30 (def- sname (string "build" sep "geom" modext))
31 (add-dep lname "lib2geom.a")
32 (add-dep sname "lib2geom.a")