Browse Source

Improved building

* Only build all tests if they're succeeding
* Update cakelisp for add-c-search-directory and add-build-options
* Replace some remaining nullptrs with null
pitch-detection
Macoy Madson 3 years ago
parent
commit
06aa21bcfe
  1. 6
      Build_Debug.sh
  2. 2
      Dependencies/cakelisp
  3. 20
      src/OgreCore.cake
  4. 8
      src/SDL.cake
  5. 2
      test/OgreApp.cake
  6. 6
      test/SDLOgreApp.cake

6
Build_Debug.sh

@ -8,11 +8,11 @@
# ./Dependencies/cakelisp/bin/cakelisp --verbose-compile-time-build-objects src/AutoTest.cake src/SDL.cake src/Tracy.cake
echo "\n\nOgre\n\n"
./Dependencies/cakelisp/bin/cakelisp --verbose-processes test/OgreApp.cake
./Dependencies/cakelisp/bin/cakelisp --verbose-processes test/OgreApp.cake || exit $?
echo "\n\nSDL Ogre\n\n"
./Dependencies/cakelisp/bin/cakelisp --verbose-processes test/SDLOgreApp.cake
./Dependencies/cakelisp/bin/cakelisp --verbose-processes test/SDLOgreApp.cake || exit $?
echo "\n\nAuto Test\n\n"
./Dependencies/cakelisp/bin/cakelisp --verbose-processes src/AutoTest.cake src/SDL.cake src/Tracy.cake
./Dependencies/cakelisp/bin/cakelisp --verbose-processes src/AutoTest.cake src/SDL.cake src/Tracy.cake || exit $?
# echo "\n\nOgre\n\n"

2
Dependencies/cakelisp

@ -1 +1 @@
Subproject commit cd480d3522ad4a4accf55c02ec6e817807979cc8
Subproject commit 4bacdedb037aee9f23bef9029746f2b045e159cf

20
src/OgreCore.cake

@ -115,19 +115,13 @@
(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")
(add-build-options "-DOGRE_DEBUG_MODE=1")
(add-c-search-directory "Dependencies/ogre-next/OgreMain/include"
"Dependencies/ogre-next/Components/Hlms/Common/include"
"Dependencies/ogre-next/Components/Hlms/Pbs/include"
"Dependencies/ogre-next/Components/Hlms/Unlit/include"
"Dependencies/ogre-next/build/Debug/include"
"Dependencies/ogre-next/Components/Overlay/include")
;; TODO: Automatically build Ogre if it isn't built yet
;; TODO: Copy necessary files (Hlms materials etc.) so self-test/user exes can run

8
src/SDL.cake

@ -58,7 +58,6 @@
(SDL_DestroyWindow window)
(SDL_Quit))
;; TODO: Automatically promote this if no main is defined. Separate target instead?
(defun test--sdl-main (&return int)
(printf "Hello, SDL!\n")
(var window (* SDL_Window) null)
@ -90,12 +89,7 @@
;; For now, an easy way to build files which include SDL headers
(defmacro module-use-sdl-build-options ()
(tokenize-push output
(set-module-option build-time-compiler "/usr/bin/clang++")
;; Include cakelisp source for DynamicLoader.hpp
(set-module-option build-time-compile-arguments
"-Werror" "-Wall" "-Wextra" "-Wno-unused-parameter" "-Wno-unused-variable"
"-g" "-c" 'source-input "-o" 'object-output "-fPIC"
"-IDependencies/SDL/buildSDLBuild/include/SDL2"))
(add-c-search-directory "-IDependencies/SDL/buildSDLBuild/include/SDL2"))
(return true))
(module-use-sdl-build-options)

2
test/OgreApp.cake

@ -11,7 +11,7 @@
(var monkey-mesh mesh-handle (ogre-load-mesh "Suzanne.mesh"))
(var monkey-node scene-node (ogre-node-from-item monkey-mesh))
(var exit-reason (* (const char)) nullptr)
(var exit-reason (* (const char)) null)
(var x float 0.f)
(var y float 0.f)

6
test/SDLOgreApp.cake

@ -9,7 +9,7 @@
(module-use-sdl-build-options)
(defun main (&return int)
(var window (* SDL_Window) nullptr)
(var window (* SDL_Window) null)
(unless (sdl-initialize (addr window))
(return 1))
;; Ogre uses exceptions for error handling, so we can't gracefully close without getting all that
@ -20,7 +20,7 @@
(var monkey-mesh mesh-handle (ogre-load-mesh "Suzanne.mesh"))
(var monkey-node scene-node (ogre-node-from-item monkey-mesh))
(var exit-reason (* (const char)) nullptr)
(var exit-reason (* (const char)) null)
(var x float 0.f)
(var y float 0.f)
@ -38,7 +38,7 @@
(set exit-reason "Window closed")))
;; Note: this requires SDL_PollEvent in order to be up-to-date
(var currentKeyStates (* (const Uint8)) (SDL_GetKeyboardState nullptr))
(var currentKeyStates (* (const Uint8)) (SDL_GetKeyboardState null))
(when (at SDL_SCANCODE_ESCAPE currentKeyStates)
(set exit-reason "Escape pressed"))

Loading…
Cancel
Save