Setting up
meson setup buildln -s `readlink -f src/scheme` build/schemeln -s `readlink -f ../SDL` subprojects/sdl2
ls -alh subprojects/sdl2 # subprojects/sdl2 -> xxxx/SDL
ln -s `readlink -f ../s7` subprojects/s7
ls -alh subprojects/s7
ln -s `readlink -f ../SDL_net` subprojects/sdl_net
ls -alh subprojects/sdl_net # subprojects/sdl_net -> xxxx/SDL_net
# file dialog: needed for some examples
ln -s `readlink -f ../nativefiledialog` subprojects/nfdBuild
ninja -C buildClean
ninja -C build -t cleanRebuilding (only our things, not the subprojects) Useful to check for warnings etc
rm -rf build/src
rm -rf build/test
ninja -C build# for the scheme sources
ln -s `readlink -f src/scheme` build/scheme
# eclipse debug build
ln -s `readlink -f src/scheme` build/meson.debug.linux.x86_64/scheme
meson setup --reconfigure build
meson setup --wipe build
rm -rf buildSetting up
meson setup build/release -Dbuildtype=release
meson configure build/release # validating the buildtype
ninja -C build/release- debug build weights ~7mb
- release build ~4mb zipped ~1.3mb
- do not build tests.. duh
#ninja -C build
#./build/test/gtest-all
ninja -C build testYou can just connect from your terminal to the running instance
netcat localhost 12345However, using emacs is the way to go
(save-selected-window
(run-scheme "netcat localhost 1234")
;; sending something to see if the repl process is alive
(scheme-send-string "\n"))cmd
mklink /J build\scheme src\scheme
exitcmd
mklink /J subprojects\sdl2 ..\SDL
# etc..
exitPreparting the project, building & some notes
cmd //k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
meson setup build --backend vs
meson compile -C build
# useful commands
meson setup build --reconfigure --backend vs
meson setup build --wipe --backend vs
rm -rf build
# scheme scripts
mklink /J build\scheme src\scheme
Note: has to be ran in the build/test dir. Cause of some paths.. ugh..
cd build/test
./gtest-allninja -C build
./build/examples/example_imguiHave to be ran under the build/test directory (assuming you ran meson setup build)
./gtest-allTo run specific tests:
./gtest-all --gtest_filter=c_primitives.float_arrbuild/repl test/scheme/test-all.scm
build/repl test/scheme/test-core.scmNormal Repl
(run-scheme (concat (projectile-project-root) "build/repl " file)) “GUI” Repl. The C++ code will call setup and draw functions
(run-scheme (concat (projectile-project-root) "build/gui_repl " file)) Generating an org-mode file from the generated ns-doc.el
First, we have to run the test/scheme/gen-doc.scm (this produces the docs/ns-doc.el )
./build/repl test/scheme/gen-doc.scmGenerating a markdown document
(with-temp-buffer
;; (org-mode)
(let ((ns-doc (read (get-file-contents
(expand-file-name "docs/ns-doc.el" )))))
(mapcar (lambda (ns)
(beginning-of-line)
(insert (format "# `%s`" (car ns)))
(newline)
;; the ns documentation
(insert (format "%s" (cadr ns)))
(newline)
;; going through the functions
(mapcar (lambda (fun)
(print fun)
;; fun is usually (name . docstring)
;; but in some weird case it's (name [] docstring)
;; eg when the name is "new-char[]" what emacs reads is
;; (new-char [] "the docstring..")
;;
;; could actually solve this also by exporting a string instead of symbol
;; for the function name
(let ((fun-name (if (stringp (cdr fun))
(car fun)
(format "%s%s" (car fun) (cadr fun))
))
(fun-docstring (if (stringp (cdr fun))
(cdr fun)
(cddr fun))))
(insert (format "## %s" fun-name))
(newline)
(insert (format "%s" fun-docstring))
(newline)))
(cddr ns)))
ns-doc)
(if (string-empty-p out)
(buffer-string)
(write-file (expand-file-name out) nil))))