Browse Source

Update cakelisp for linker options

This speeds up building by not requiring compile-time hooks to add
link arguments. It's also cleaner.
pitch-detection
Macoy Madson 1 year ago
parent
commit
db3c56c941
  1. 4
      Build_Debug.sh
  2. 2
      Dependencies/cakelisp
  3. 43
      src/Ogre.cake
  4. 28
      src/SDL.cake
  5. 10
      src/Tracy.cake
  6. 61
      test/src/Loader.cake

4
Build_Debug.sh

@ -17,10 +17,10 @@ echo "\n\nVocal Game (hot reload)\n\n"
./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/Config_Linux.cake test/src/Loader.cake || exit $?
./Dependencies/cakelisp/bin/cakelisp --execute test/src/Config_Linux.cake test/src/Loader.cake || exit $?
echo "\n\nVocal Game (no reload)\n\n"
./Dependencies/cakelisp/bin/cakelisp \
./Dependencies/cakelisp/bin/cakelisp --execute \
test/src/Config_Linux.cake test/src/NoHotReload.cake test/src/VocalGame.cake || exit $?
# TESTING

2
Dependencies/cakelisp

@ -1 +1 @@
Subproject commit 2193012e5fb24157fc07f2fe9e3bbf82b819e1fa
Subproject commit 162b9304104c7335487109c899b1a8fc23d959a4

43
src/Ogre.cake

@ -301,30 +301,19 @@ ln -s %s %s\n" ogre-dependencies-dir-output ogre-deps-softlink)
(use-ogre-build-options)
(defun-comptime ogre-link-hook (manager (& ModuleManager)
linkCommand (& ProcessCommand)
linkTimeInputs (* ProcessCommandInput) numLinkTimeInputs int
&return bool)
;; TODO: Expose this option somehow?
(var is-debug-build bool true)
(printf "OgreCore: Adding %s link arguments\n" (? is-debug-build "debug" "release"))
(if is-debug-build
(block
(command-add-string-argument linkCommand "-LDependencies/ogre-next/build/Debug/lib")
(command-add-string-argument linkCommand "-lOgreHlmsPbs_d")
(command-add-string-argument linkCommand "-lOgreHlmsUnlit_d")
(command-add-string-argument linkCommand "-lOgreMain_d")
(command-add-string-argument linkCommand "-lOgreOverlay_d")
(command-add-string-argument linkCommand "-Wl,-rpath,.:../Dependencies/ogre-next/build/Debug/lib"))
(block
(command-add-string-argument linkCommand "-LDependencies/ogre-next/build/Release/lib")
(command-add-string-argument linkCommand "-lOgreHlmsPbs")
(command-add-string-argument linkCommand "-lOgreHlmsUnlit")
(command-add-string-argument linkCommand "-lOgreMain")
(command-add-string-argument linkCommand "-lOgreOverlay")
(command-add-string-argument linkCommand "-Wl,-rpath,.:../Dependencies/ogre-next/build/Release/lib")))
(return true))
(add-compile-time-hook pre-link ogre-link-hook)
(add-library-search-directory "Dependencies/ogre-next/build/Debug/lib")
(add-library-dependency "OgreHlmsPbs_d"
"OgreHlmsUnlit_d"
"OgreMain_d"
"OgreOverlay_d")
;; TODO: Relative path is going to break for sure
(add-library-runtime-search-directory "../Dependencies/ogre-next/build/Debug/lib" ".")
;; Release. TODO: Use comptime-cond to allow this to be opted in
;; (add-library-search-directory "Dependencies/ogre-next/build/Release/lib")
;; (add-library-dependency "OgreHlmsPbs"
;; "OgreHlmsUnlit"
;; "OgreMain"
;; "OgreOverlay")
;; ;; TODO: Relative path is going to break for sure
;; (add-library-runtime-search-directory "../Dependencies/ogre-next/build/Release/lib" ".")

28
src/SDL.cake

@ -168,26 +168,8 @@ Note that you can also build SDL manually. This can be useful if you are porting
(module-use-sdl-build-options)
(defun-comptime sdl-link-hook (manager (& ModuleManager)
linkCommand (& ProcessCommand)
linkTimeInputs (* ProcessCommandInput) numLinkTimeInputs int
&return bool)
;; TODO: Expose this option somehow?
(var is-debug-build bool true)
(printf "SDL: Adding %s link arguments\n" (? is-debug-build "debug" "release"))
(if is-debug-build
;; TODO: Actually add debug build
(block
(command-add-string-argument linkCommand "-LDependencies/SDL/buildSDLBuild/lib")
(command-add-string-argument linkCommand "-lSDL2")
(command-add-string-argument linkCommand "-Wl,-rpath,.:../Dependencies/SDL/buildSDLBuild/lib"))
(block
(command-add-string-argument linkCommand "-LDependencies/SDL/buildSDLBuild/lib")
(command-add-string-argument linkCommand "-lSDL2")
(command-add-string-argument linkCommand "-Wl,-rpath,.:../Dependencies/SDL/buildSDLBuild/lib")))
(return true))
(add-compile-time-hook pre-link sdl-link-hook)
;; TODO: Add debug version
(add-library-search-directory "Dependencies/SDL/buildSDLBuild/lib")
(add-library-dependency "SDL2")
;; TODO: Relative path is going to break for sure
(add-library-runtime-search-directory "../Dependencies/SDL/buildSDLBuild/lib" ".")

10
src/Tracy.cake

@ -37,12 +37,4 @@
(add-cpp-build-dependency "../Dependencies/tracy/TracyClient.cpp")
(defun-comptime tracy-link-hook (manager (& ModuleManager)
linkCommand (& ProcessCommand)
linkTimeInputs (* ProcessCommandInput) numLinkTimeInputs int
&return bool)
(command-add-string-argument linkCommand "-lpthread")
(command-add-string-argument linkCommand "-ldl")
(return true))
(add-compile-time-hook pre-link tracy-link-hook)
(add-library-dependency "pthread" "dl")

61
test/src/Loader.cake

@ -46,54 +46,15 @@
;;
;; Libraries
;;
(defun-comptime ogre-link-hook-copy (manager (& ModuleManager)
linkCommand (& ProcessCommand)
linkTimeInputs (* ProcessCommandInput) numLinkTimeInputs int
&return bool)
;; TODO: Expose this option somehow?
(var is-debug-build bool true)
(printf "OgreCore: Adding %s link arguments\n" (? is-debug-build "debug" "release"))
(if is-debug-build
(block
(command-add-string-argument linkCommand "-LDependencies/ogre-next/build/Debug/lib")
(command-add-string-argument linkCommand "-lOgreHlmsPbs_d")
(command-add-string-argument linkCommand "-lOgreHlmsUnlit_d")
(command-add-string-argument linkCommand "-lOgreMain_d")
(command-add-string-argument linkCommand "-lOgreOverlay_d")
(command-add-string-argument linkCommand "-Wl,-rpath,.:../Dependencies/ogre-next/build/Debug/lib"))
(block
(command-add-string-argument linkCommand "-LDependencies/ogre-next/build/Release/lib")
(command-add-string-argument linkCommand "-lOgreHlmsPbs")
(command-add-string-argument linkCommand "-lOgreHlmsUnlit")
(command-add-string-argument linkCommand "-lOgreMain")
(command-add-string-argument linkCommand "-lOgreOverlay")
(command-add-string-argument linkCommand "-Wl,-rpath,.:../Dependencies/ogre-next/build/Release/lib")))
(return true))
(add-compile-time-hook pre-link ogre-link-hook-copy)
(defun-comptime sdl-link-hook-copy (manager (& ModuleManager)
linkCommand (& ProcessCommand)
linkTimeInputs (* ProcessCommandInput) numLinkTimeInputs int
&return bool)
;; TODO: Expose this option somehow?
(var is-debug-build bool true)
(printf "SDL: Adding %s link arguments\n" (? is-debug-build "debug" "release"))
(if is-debug-build
;; TODO: Actually add debug build
(block
(command-add-string-argument linkCommand "-LDependencies/SDL/buildSDLBuild/lib")
(command-add-string-argument linkCommand "-lSDL2")
(command-add-string-argument linkCommand "-Wl,-rpath,.:../Dependencies/SDL/buildSDLBuild/lib"))
(block
(command-add-string-argument linkCommand "-LDependencies/sdl-next/build/Release/lib")
(command-add-string-argument linkCommand "-lSDL2")
(command-add-string-argument linkCommand "-Wl,-rpath,.:../Dependencies/SDL/buildSDLBuild/lib")))
(return true))
(add-compile-time-hook pre-link sdl-link-hook-copy)
;; TODO: Is this necessary to include? (will they be unloaded when the hot-lib is unloaded,
;; losing their state?)
;; TODO: Add debug version
(add-library-search-directory "Dependencies/ogre-next/build/Debug/lib" "Dependencies/SDL/buildSDLBuild/lib")
(add-library-dependency "OgreHlmsPbs_d"
"OgreHlmsUnlit_d"
"OgreMain_d"
"OgreOverlay_d"
"SDL2")
;; TODO: Relative path is going to break for sure
(add-library-runtime-search-directory "../Dependencies/ogre-next/build/Debug/lib" "." "../Dependencies/SDL/buildSDLBuild/lib")

Loading…
Cancel
Save