Browse Source

Fix hot reloading

* Update Cakelisp for hot-reloading fixes, DynamicLoader.cake
* Specify 'Unix so DynamicLoader.cake properly generates Linux code
* Clean up after finishing loader execution
* Remove unnecessary search dirs
pitch-detection
Macoy Madson 2 years ago
parent
commit
b34b0df9fc
  1. 2
      BuildHotReloadable.sh
  2. 4
      Build_Debug.sh
  3. 2
      Dependencies/cakelisp
  4. 3
      test/src/Config_Linux.cake
  5. 8
      test/src/Loader.cake
  6. 8
      test/src/MakeHotReload.cake

2
BuildHotReloadable.sh

@ -2,4 +2,4 @@
echo "\n\nVocal Game (reloadable)\n\n"
./Dependencies/cakelisp/bin/cakelisp --verbose-processes \
test/src/MakeHotReload.cake test/src/VocalGame.cake || exit $?
test/src/Config_Linux.cake test/src/MakeHotReload.cake test/src/VocalGame.cake || exit $?

4
Build_Debug.sh

@ -8,10 +8,10 @@ echo "\n\nAuto Test\n\n"
./Dependencies/cakelisp/bin/cakelisp src/AutoTest.cake src/Math.cake src/SDL.cake src/Tracy.cake || exit $?
echo "\n\nVocal Game (hot reload)\n\n"
./Dependencies/cakelisp/bin/cakelisp test/src/MakeHotReload.cake test/src/VocalGame.cake || exit $?
./Dependencies/cakelisp/bin/cakelisp test/src/Config_Linux.cake test/src/MakeHotReload.cake test/src/VocalGame.cake || exit $?
echo "\n\nLoader\n\n"
./Dependencies/cakelisp/bin/cakelisp test/src/Loader.cake || exit $?
./Dependencies/cakelisp/bin/cakelisp test/src/Config_Linux.cake test/src/Loader.cake || exit $?
echo "\n\nVocal Game (no reload)\n\n"
./Dependencies/cakelisp/bin/cakelisp \

2
Dependencies/cakelisp

@ -1 +1 @@
Subproject commit bab33b7b0744af46faefc857bce8aec2b97e45a4
Subproject commit 3c8825cc7d2ff9353d2e39ce986a994e13762348

3
test/src/Config_Linux.cake

@ -0,0 +1,3 @@
(skip-build)
(comptime-define-symbol 'Unix)
(comptime-define-symbol 'Fancy-Versioning)

8
test/src/Loader.cake

@ -13,17 +13,14 @@
;; (import "src/Ogre.cake"
;; "src/SDL.cake")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(import &comptime-only "Options.cake" "Macros.cake")
;; TODO: Should this happen automatically, because import automatically adds current working dir?
;; Should it add working dir?
(add-c-search-directory module ".")
;; So HotReloading.cake can find DynamicLoader.hpp
(add-c-search-directory global "Dependencies/cakelisp/src")
(import "HotReloading.cake")
(c-import "stdio.h")
(defun main (&return int)
@ -35,12 +32,15 @@
(unless (do-hot-reload)
(printf "error: failed to load\n")
(hot-reload-clean-up)
(return 1))
(while (hot-reload-entry-point-func)
(unless (do-hot-reload)
(printf "error: failed to hot-reload\n")
(hot-reload-clean-up)
(return 1)))
(hot-reload-clean-up)
(return 0))
;;

8
test/src/MakeHotReload.cake

@ -2,9 +2,5 @@
(set-cakelisp-option executable-output "test/libGeneratedCakelisp.so")
;; Include cakelisp source for DynamicLoader.hpp
(add-c-search-directory global "Dependencies/cakelisp/src")
(import "Dependencies/cakelisp/runtime/HotReloadingCodeModifier.cake")
(add-c-search-directory global "Dependencies/cakelisp/runtime")
(add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
(import "HotReloadingCodeModifier.cake")

Loading…
Cancel
Save