|
|
@ -153,3 +153,69 @@ |
|
|
|
;; (getNextArgument tokens current-index end-invocation-index)) |
|
|
|
(incr current-index)) |
|
|
|
(return true)) |
|
|
|
|
|
|
|
;; |
|
|
|
;; Building |
|
|
|
;; |
|
|
|
|
|
|
|
;; TODO: Relative vs. absolute paths |
|
|
|
(import &comptime-only "../Dependencies/cakelisp/runtime/Macros.cake") |
|
|
|
(add-cpp-build-dependency "OgreInitialize.cpp") |
|
|
|
|
|
|
|
(set-module-option build-time-compiler "/usr/bin/clang++") |
|
|
|
;; Include cakelisp source for DynamicLoader.hpp |
|
|
|
(set-module-option build-time-compile-arguments |
|
|
|
"-std=c++11" "-Wall" "-Wextra" "-Wno-unused-parameter" |
|
|
|
"-g" "-c" 'source-input "-o" 'object-output "-fPIC" |
|
|
|
;; Ogre options |
|
|
|
"-DOGRE_DEBUG_MODE=1" |
|
|
|
"-IDependencies/ogre-next/OgreMain/include" |
|
|
|
"-IDependencies/ogre-next/Components/Hlms/Common/include" |
|
|
|
"-IDependencies/ogre-next/Components/Hlms/Pbs/include" |
|
|
|
"-IDependencies/ogre-next/Components/Hlms/Unlit/include" |
|
|
|
"-IDependencies/ogre-next/build/Debug/include" |
|
|
|
"-IDependencies/ogre-next/Components/Overlay/include") |
|
|
|
|
|
|
|
;; (defun-comptime ogre-pre-build-hook () |
|
|
|
;; (unless (fileExists "Dependencies/ogre-next/build/Debug/lib") |
|
|
|
;; (printf "error: Ogre is not built yet. Please run ./BuildDependencies_Debug.sh\n") |
|
|
|
;; (return false)) |
|
|
|
;; (return true)) |
|
|
|
;; (add-compile-time-hook-module pre-build ogre-pre-build-hook) |
|
|
|
|
|
|
|
(defmacro command-add-string-argument () |
|
|
|
(destructure-arguments new-argument-index) |
|
|
|
(quick-token-at new-argument new-argument-index) |
|
|
|
(tokenize-push output (on-call (field linkCommand arguments) push_back |
|
|
|
(array ProcessCommandArgumentType_String |
|
|
|
(token-splice (addr new-argument))))) |
|
|
|
(return true)) |
|
|
|
|
|
|
|
(defun-comptime ogre-link-hook (manager (& ModuleManager) |
|
|
|
linkCommand (& ProcessCommand) |
|
|
|
linkTimeInputs (* ProcessCommandInput) numLinkTimeInputs int |
|
|
|
&return bool) |
|
|
|
;; TODO: Expose this option somehow? |
|
|
|
(var debug bool true) |
|
|
|
|
|
|
|
(printf "OgreCore: Adding %s link arguments\n" (? debug "debug" "release")) |
|
|
|
|
|
|
|
(if debug |
|
|
|
(block |
|
|
|
(command-add-string-argument "-LDependencies/ogre-next/build/Debug/lib") |
|
|
|
(command-add-string-argument "-lOgreHlmsPbs_d") |
|
|
|
(command-add-string-argument "-lOgreHlmsUnlit_d") |
|
|
|
(command-add-string-argument "-lOgreMain_d") |
|
|
|
(command-add-string-argument "-lOgreOverlay_d") |
|
|
|
(command-add-string-argument "-Wl,-rpath,.:../Dependencies/ogre-next/build/Debug/lib")) |
|
|
|
(block |
|
|
|
(command-add-string-argument "-LDependencies/ogre-next/build/Release/lib") |
|
|
|
(command-add-string-argument "-lOgreHlmsPbs") |
|
|
|
(command-add-string-argument "-lOgreHlmsUnlit") |
|
|
|
(command-add-string-argument "-lOgreMain") |
|
|
|
(command-add-string-argument "-lOgreOverlay") |
|
|
|
(command-add-string-argument "-Wl,-rpath,.:../Dependencies/ogre-next/build/Release/lib"))) |
|
|
|
|
|
|
|
(return true)) |
|
|
|
(add-compile-time-hook pre-link ogre-link-hook) |
|
|
|
|
|
|
|