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 months ago
parent
commit
b34b0df9fc
6 changed files with 13 additions and 14 deletions
  1. +1
    -1
      BuildHotReloadable.sh
  2. +2
    -2
      Build_Debug.sh
  3. +1
    -1
      Dependencies/cakelisp
  4. +3
    -0
      test/src/Config_Linux.cake
  5. +4
    -4
      test/src/Loader.cake
  6. +2
    -6
      test/src/MakeHotReload.cake

+ 1
- 1
BuildHotReloadable.sh View File

@ -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 $?

+ 2
- 2
Build_Debug.sh View File

@ -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 \


+ 1
- 1
Dependencies/cakelisp

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

+ 3
- 0
test/src/Config_Linux.cake View File

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

+ 4
- 4
test/src/Loader.cake View File

@ -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))
;;


+ 2
- 6
test/src/MakeHotReload.cake View File

@ -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