From 98f8246323061025870dcecef82674170daf4602 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 17 Jun 2013 13:45:03 +0000 Subject: [PATCH] build: lol-build now passes flags to configure, and configure now uses optimisation flag -Os instead of -O3. --- build/build-android | 6 ++-- build/build-html | 6 ++-- build/build-mingw | 6 ++-- build/build-mingw64 | 6 ++-- build/build-nacl32 | 6 ++-- build/build-nacl64 | 6 ++-- build/build-ps3 | 6 ++-- build/build-raspi | 6 ++-- build/lol-build | 59 ++++++++++++++++++++++++------- configure.ac | 49 ++++++++++++++++--------- src/dict.cpp | 4 +-- src/entity.cpp | 8 ++--- src/entity.h | 2 +- src/image/codec/android-image.cpp | 8 ++--- src/image/codec/gdiplus-image.cpp | 10 +++--- src/image/codec/ios-image.cpp | 2 +- src/image/codec/sdl-image.cpp | 2 +- src/ticker.cpp | 28 +++++++-------- test/unit/build.cpp | 2 +- 19 files changed, 135 insertions(+), 87 deletions(-) diff --git a/build/build-android b/build/build-android index aa2c637a..b96ab7ed 100755 --- a/build/build-android +++ b/build/build-android @@ -4,7 +4,7 @@ make distclean set -e -./build/lol-build bootstrap android-arm -./build/lol-build configure android-arm -./build/lol-build build android-arm +./build/lol-build "$@" bootstrap android-arm +./build/lol-build "$@" configure android-arm +./build/lol-build "$@" build android-arm diff --git a/build/build-html b/build/build-html index 4d240c2f..2064d026 100755 --- a/build/build-html +++ b/build/build-html @@ -4,7 +4,7 @@ make distclean set -e -./build/lol-build bootstrap emscripten-html -./build/lol-build configure emscripten-html -./build/lol-build build emscripten-html +./build/lol-build "$@" bootstrap emscripten-html +./build/lol-build "$@" configure emscripten-html +./build/lol-build "$@" build emscripten-html diff --git a/build/build-mingw b/build/build-mingw index 59b3196c..9598b38a 100755 --- a/build/build-mingw +++ b/build/build-mingw @@ -4,7 +4,7 @@ make distclean set -e -./build/lol-build bootstrap windows-i386 -./build/lol-build configure windows-i386 -./build/lol-build build windows-i386 +./build/lol-build "$@" bootstrap windows-i386 +./build/lol-build "$@" configure windows-i386 +./build/lol-build "$@" build windows-i386 diff --git a/build/build-mingw64 b/build/build-mingw64 index f23398ae..cdbf4e4a 100755 --- a/build/build-mingw64 +++ b/build/build-mingw64 @@ -4,7 +4,7 @@ make distclean set -e -./build/lol-build bootstrap windows-amd64 -./build/lol-build configure windows-amd64 -./build/lol-build build windows-amd64 +./build/lol-build "$@" bootstrap windows-amd64 +./build/lol-build "$@" configure windows-amd64 +./build/lol-build "$@" build windows-amd64 diff --git a/build/build-nacl32 b/build/build-nacl32 index 09006d0c..2cb0c420 100755 --- a/build/build-nacl32 +++ b/build/build-nacl32 @@ -4,7 +4,7 @@ make distclean set -e -./build/lol-build bootstrap nacl-i386 -./build/lol-build configure nacl-i386 -./build/lol-build build nacl-i386 +./build/lol-build "$@" bootstrap nacl-i386 +./build/lol-build "$@" configure nacl-i386 +./build/lol-build "$@" build nacl-i386 diff --git a/build/build-nacl64 b/build/build-nacl64 index 647a444c..850313fe 100755 --- a/build/build-nacl64 +++ b/build/build-nacl64 @@ -4,7 +4,7 @@ make distclean set -e -./build/lol-build bootstrap nacl-amd64 -./build/lol-build configure nacl-amd64 -./build/lol-build build nacl-amd64 +./build/lol-build "$@" bootstrap nacl-amd64 +./build/lol-build "$@" configure nacl-amd64 +./build/lol-build "$@" build nacl-amd64 diff --git a/build/build-ps3 b/build/build-ps3 index b2b73d72..c75277d6 100755 --- a/build/build-ps3 +++ b/build/build-ps3 @@ -4,7 +4,7 @@ make distclean set -e -./build/lol-build bootstrap ps3-ppu -./build/lol-build configure ps3-ppu -./build/lol-build build ps3-ppu +./build/lol-build "$@" bootstrap ps3-ppu +./build/lol-build "$@" configure ps3-ppu +./build/lol-build "$@" build ps3-ppu diff --git a/build/build-raspi b/build/build-raspi index 9b44223c..4b1728ad 100755 --- a/build/build-raspi +++ b/build/build-raspi @@ -4,7 +4,7 @@ make distclean set -e -./build/lol-build bootstrap raspi-arm -./build/lol-build configure raspi-arm -./build/lol-build build raspi-arm +./build/lol-build "$@" bootstrap raspi-arm +./build/lol-build "$@" configure raspi-arm +./build/lol-build "$@" build raspi-arm diff --git a/build/lol-build b/build/lol-build index 1fef7e1d..f64aa9c0 100755 --- a/build/lol-build +++ b/build/lol-build @@ -3,7 +3,12 @@ # # Lol Engine build script # Usage: -# lol-build [] +# lol-build [...] [] +# +# Supported flags: +# --enable-debug +# --enable-devel +# --enable-release # # Where is one of: # - bootstrap @@ -30,8 +35,31 @@ set -e -action="$1" -platform="$2" +############################################################################### +# Commandline parsing +# +action="" +platform="" +configure_flags="" +while [ "$#" -gt 0 ]; do + case "$1" in + --enable-debug|--enable-devel|--enable-release) + configure_flags="${configure_flags} $1" + ;; + --*) + echo "E: invalid flag $1" + exit 1 + ;; + *) + if [ -z "$action" ]; then + action="$1" + else + platform="$1" + fi + ;; + esac + shift +done ############################################################################### # Initialisation code @@ -106,6 +134,11 @@ bootstrap() esac } +do_configure() +{ + ./configure ${configure_flags} "$@" +} + configure() { cd "$top_srcdir" @@ -188,34 +221,34 @@ configure() SDKROOT="$DEVROOT/SDKs/iPhoneOS$SDKVER.sdk" CC="$XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" CXX="$XCODE/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" - ./configure --host=armv7-apple-darwin10 CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" CXX="$CXX" + do_configure --host=armv7-apple-darwin10 CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" CC="$CC" CXX="$CXX" ;; android-arm) CPPFLAGS="$CPPFLAGS -Wno-psabi -I$ANDROID_NDK_ROOT/sources/cxx-stl/stlport/stlport -I$ANDROID_NDK_ROOT/sources/android/native_app_glue -fpic -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64" CFLAGS="$CFLAGS -march=armv5te -mtune=xscale -msoft-float -mthumb" CXXFLAGS="$CXXFLAGS -march=armv5te -mtune=xscale -msoft-float -mthumb -fno-rtti -fno-exceptions" LOL_LIBS="$LOL_LIBS -L$ANDROID_NDK_ROOT/sources/cxx-stl/stlport/libs/armeabi -lstlport_shared -lm -fpic -XCClinker -shared -u ANativeActivity_onCreate" - PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure --host=arm-linux-androideabi ac_cv_exeext=.so CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" LOL_LIBS="$LOL_LIBS" + PKG_CONFIG_PATH="$PKG_CONFIG_PATH" do_configure --host=arm-linux-androideabi ac_cv_exeext=.so CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" LOL_LIBS="$LOL_LIBS" # FIXME: is this needed? # ant debug # ant debug install # ant clean ;; raspi-arm) - ./configure --host=arm-bcm2708hardfp-linux-gnueabi CPPFLAGS="-I$RASPI_SDK_ROOT/firmware/opt/vc/include -I$RASPI_SDK_ROOT/firmware/opt/vc/include/interface/vcos/pthreads -I$RASPI_SDK_ROOT/chroot/usr/include" LDFLAGS="-L$RASPI_SDK_ROOT/firmware/opt/vc/lib -L$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -L$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,--unresolved-symbols=ignore-in-shared-libs" + do_configure --host=arm-bcm2708hardfp-linux-gnueabi CPPFLAGS="-I$RASPI_SDK_ROOT/firmware/opt/vc/include -I$RASPI_SDK_ROOT/firmware/opt/vc/include/interface/vcos/pthreads -I$RASPI_SDK_ROOT/chroot/usr/include" LDFLAGS="-L$RASPI_SDK_ROOT/firmware/opt/vc/lib -L$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/lib/arm-linux-gnueabihf -L$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link -Wl,$RASPI_SDK_ROOT/chroot/usr/lib/arm-linux-gnueabihf -Wl,--unresolved-symbols=ignore-in-shared-libs" ;; nacl-i386) - ./configure CXX=i686-nacl-g++ CC=i686-nacl-gcc ac_cv_exeext=.32.nexe --host=i386 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" + do_configure CXX=i686-nacl-g++ CC=i686-nacl-gcc ac_cv_exeext=.32.nexe --host=i386 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" ;; nacl-amd64) - ./configure CXX=x86_64-nacl-g++ CC=x86_64-nacl-gcc ac_cv_exeext=.64.nexe --host=x86_64 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" + do_configure CXX=x86_64-nacl-g++ CC=x86_64-nacl-gcc ac_cv_exeext=.64.nexe --host=x86_64 CPPFLAGS="-I$NACL_SDK_ROOT/include" LOL_LIBS="-lppapi -lppapi_gles2 -lppapi_cpp -u _ZN2pp12CreateModuleEv" ;; osx-amd64) # HACK: use clang++ because of a memory leak in llvm-g++. - ./configure CXX=clang++ CC=clang + do_configure CXX=clang++ CC=clang ;; ps3-ppu) - PATH="$PATH" ./configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=powerpc + PATH="$PATH" do_configure CXX=ppu-lv2-g++ CC=ppu-lv2-gcc ac_cv_exeext=.elf --host=powerpc ;; win*-i386|win*-amd64) CPPFLAGS="$CPPFLAGS -I$PWD/external/sdl-1.2.15/include" @@ -239,13 +272,13 @@ configure() CPPFLAGS="$CPPFLAGS -I$PWD/external/libcaca-0.99.beta18/include -DCACA_STATIC" - PATH="$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS" + PATH="$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" do_configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS" ;; emscripten-*) - ./configure $HOSTFLAGS $BUILDFLAGS CC=emcc CXX=em++ AR=emar RANLIB=emranlib PKG_CONFIG=/bin/false SDL_CONFIG=/bin/false ac_cv_exeext=".${platform##emscripten-}" + do_configure $HOSTFLAGS $BUILDFLAGS CC=emcc CXX=em++ AR=emar RANLIB=emranlib PKG_CONFIG=/bin/false SDL_CONFIG=/bin/false ac_cv_exeext=".${platform##emscripten-}" ;; *) - PATH="$PATH" ./configure CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS" + PATH="$PATH" do_configure CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS" ;; esac } diff --git a/configure.ac b/configure.ac index af4ded99..96956530 100644 --- a/configure.ac +++ b/configure.ac @@ -101,26 +101,41 @@ AC_CHECK_FUNCS(getenv system tmpfile tmpnam getcwd _getcwd backtrace_symbols) AC_CHECK_FUNCS(gettimeofday usleep) -if test "${enable_debug}" = "yes"; then - AC_DEFINE(LOL_DEBUG, 1, Define to 1 to activate debug) - OPT_CXXFLAGS="-O" -else - OPT_CXXFLAGS="-O3 -ffast-math -fomit-frame-pointer" - OPT_LDFLAGS="-fno-strength-reduce" +dnl Build mode +ac_cv_my_build_mode="devel" +if test "x${enable_release}" = "xyes"; then + ac_cv_my_build_mode="release" + CFLAGS="" + LDFLAGS="" + CXXFLAGS="" +fi +if test "x${enable_devel}" = "xyes"; then + ac_cv_my_build_mode="devel" + CFLAGS="" + LDFLAGS="" + CXXFLAGS="" +fi +if test "x${enable_debug}" = "xyes"; then + ac_cv_my_build_mode="debug" + CFLAGS="" + LDFLAGS="" + CXXFLAGS="" fi -if test "${enable_release}" = "yes"; then - AC_DEFINE(LOL_RELEASE, 1, Define to 1 to activate final release) - REL_CXXFLAGS="" +if test "x${ac_cv_my_build_mode}" = "xdebug"; then + AC_DEFINE(LOL_BUILD_DEBUG, 1, Define to 1 to activate debug build) + BUILD_CXXFLAGS="-O -g" +elif test "x${ac_cv_my_build_mode}" = "xdevel"; then + AC_DEFINE(LOL_BUILD_DEVEL, 1, Define to 1 to activate development build) + BUILD_CXXFLAGS="-Os -g -ffast-math" else - REL_CXXFLAGS="-g" + AC_DEFINE(LOL_BUILD_RELEASE, 1, Define to 1 to activate final release) + BUILD_CXXFLAGS="-Os -ffast-math -fomit-frame-pointer" + BUILD_LDFLAGS="-fno-strength-reduce" fi -if test "${enable_experimental}" = "yes"; then - AC_DEFINE(LOL_EXPERIMENTAL, 1, Define to 1 to activate experimental build) -fi -# Build documentation? +dnl Build documentation? DOXYGEN="no" LATEX="no" if test "${enable_doc}" != "no"; then @@ -166,9 +181,9 @@ dnl No exceptions LOL_TRY_CXXFLAGS(-fno-exceptions, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-exceptions"]) LOL_TRY_CXXFLAGS(-fno-rtti, [AM_CXXFLAGS="${AM_CXXFLAGS} -fno-rtti"]) -dnl Optimizations -AM_CXXFLAGS="${AM_CXXFLAGS} ${REL_CXXFLAGS} ${OPT_CXXFLAGS}" -AM_LDFLAGS="${AM_LDFLAGS} ${REL_LDFLAGS} ${OPT_LDFLAGS}" +dnl Build mode specific flags +AM_CXXFLAGS="${AM_CXXFLAGS} ${BUILD_CXXFLAGS}" +AM_LDFLAGS="${AM_LDFLAGS} ${BUILD_LDFLAGS}" dnl Debug symbols LOL_TRY_LDFLAGS(-rdynamic, [AM_LDFLAGS="${AM_LDFLAGS} -rdynamic"]) diff --git a/src/dict.cpp b/src/dict.cpp index 357f8a7a..2d452338 100644 --- a/src/dict.cpp +++ b/src/dict.cpp @@ -43,7 +43,7 @@ public: ~DictData() { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (nentities) Log::Error("still %i entities in dict\n", nentities); #endif @@ -139,7 +139,7 @@ void Dict::RemoveSlot(Entity *entity) return; } -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("removing unregistered entity %p (%s)\n", entity, entity->GetName()); #endif diff --git a/src/entity.cpp b/src/entity.cpp index f4edf2e4..97a40085 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -29,7 +29,7 @@ Entity::Entity() : m_ref(0), m_destroy(0) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE m_tickstate = STATE_IDLE; #endif m_gamegroup = GAMEGROUP_DEFAULT; @@ -39,7 +39,7 @@ Entity::Entity() : Entity::~Entity() { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (!m_destroy) Log::Error("entity destructor called directly\n"); #endif @@ -53,7 +53,7 @@ char const *Entity::GetName() void Entity::TickGame(float seconds) { UNUSED(seconds); -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (m_tickstate != STATE_PRETICK_GAME) Log::Error("invalid entity game tick\n"); m_tickstate = STATE_POSTTICK_GAME; @@ -63,7 +63,7 @@ void Entity::TickGame(float seconds) void Entity::TickDraw(float seconds) { (void)seconds; -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (m_tickstate != STATE_PRETICK_DRAW) Log::Error("invalid entity draw tick\n"); m_tickstate = STATE_POSTTICK_DRAW; diff --git a/src/entity.h b/src/entity.h index 694c358a..8f9a15c0 100644 --- a/src/entity.h +++ b/src/entity.h @@ -76,7 +76,7 @@ protected: static int const DRAWGROUP_BEGIN = GAMEGROUP_END; static int const ALLGROUP_END = DRAWGROUP_END; -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE enum { STATE_IDLE = 0, diff --git a/src/image/codec/android-image.cpp b/src/image/codec/android-image.cpp index 5240b7f2..8a182422 100644 --- a/src/image/codec/android-image.cpp +++ b/src/image/codec/android-image.cpp @@ -52,14 +52,14 @@ bool AndroidImageData::Open(char const *path) jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2); if (res < 0) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("JVM environment not found, trying to attach thread\n"); #endif res = g_vm->AttachCurrentThread(&env, nullptr); } if (res < 0) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("JVM environment not found, cannot open image %s\n", path); #endif return false; @@ -74,7 +74,7 @@ bool AndroidImageData::Open(char const *path) env->DeleteLocalRef(name); if (!bmp) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("could not load %s\n", path); #endif return false; @@ -111,7 +111,7 @@ bool AndroidImageData::Close() jint res = g_vm->GetEnv((void **)&env, JNI_VERSION_1_2); if (res < 0) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("JVM environment not found, cannot close image\n"); #endif return false; diff --git a/src/image/codec/gdiplus-image.cpp b/src/image/codec/gdiplus-image.cpp index 36814ca6..5f80eb2a 100644 --- a/src/image/codec/gdiplus-image.cpp +++ b/src/image/codec/gdiplus-image.cpp @@ -56,7 +56,7 @@ bool GdiPlusImageData::Open(char const *path) status = Gdiplus::GdiplusStartup(&token, &input, nullptr); if (status != Gdiplus::Ok) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("error %d while initialising GDI+\n", status); #endif return false; @@ -71,7 +71,7 @@ bool GdiPlusImageData::Open(char const *path) wchar_t *wpath = new wchar_t[len + 1]; if (mbstowcs(wpath, pathlist[i].C(), len + 1) == (size_t)-1) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("invalid image name %s\n", pathlist[i].C()); #endif delete[] wpath; @@ -86,7 +86,7 @@ bool GdiPlusImageData::Open(char const *path) status = m_bitmap->GetLastStatus(); if (status != Gdiplus::Ok) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (status != Gdiplus::InvalidParameter) Log::Error("error %d loading %s\n", status, pathlist[i].C()); @@ -103,7 +103,7 @@ bool GdiPlusImageData::Open(char const *path) if (!m_bitmap) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("could not load %s\n", path); #endif return false; @@ -116,7 +116,7 @@ bool GdiPlusImageData::Open(char const *path) if(m_bitmap->LockBits(&rect, Gdiplus::ImageLockModeRead, PixelFormat32bppARGB, &m_bdata) != Gdiplus::Ok) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("could not lock bits in %s\n", path); #endif delete m_bitmap; diff --git a/src/image/codec/ios-image.cpp b/src/image/codec/ios-image.cpp index 18a517e1..c842064a 100644 --- a/src/image/codec/ios-image.cpp +++ b/src/image/codec/ios-image.cpp @@ -56,7 +56,7 @@ bool IosImageData::Open(char const *path) UIImage *image = [[UIImage alloc] initWithData:pngdata]; if (!image) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("could not load %s\n", path); #endif return false; diff --git a/src/image/codec/sdl-image.cpp b/src/image/codec/sdl-image.cpp index 335fe956..47b5062b 100644 --- a/src/image/codec/sdl-image.cpp +++ b/src/image/codec/sdl-image.cpp @@ -67,7 +67,7 @@ bool SdlImageData::Open(char const *path) if (!m_img) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("could not load image %s\n", path); #endif return false; diff --git a/src/ticker.cpp b/src/ticker.cpp index f03a86b8..01d7c2b7 100644 --- a/src/ticker.cpp +++ b/src/ticker.cpp @@ -33,7 +33,7 @@ public: todolist(0), autolist(0), nentities(0), frame(0), recording(0), deltatime(0), bias(0), fps(0), -#if LOL_DEBUG +#if LOL_BUILD_DEBUG keepalive(0), #endif quit(0), quitframe(0), quitdelay(20), panic(0) @@ -46,7 +46,7 @@ public: { ASSERT(nentities == 0, "still %i entities in ticker\n", nentities); -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (autolist) { int count = 0; @@ -76,7 +76,7 @@ private: int frame, recording; Timer timer; float deltatime, bias, fps; -#if LOL_DEBUG +#if LOL_BUILD_DEBUG float keepalive; #endif @@ -162,7 +162,7 @@ int Ticker::Unref(Entity *entity) #if LOL_FEATURE_THREADS void *TickerData::GameThreadMain(void * /* p */) { -#if LOL_DEBUG +#if LOL_BUILD_DEBUG Log::Info("ticker game thread initialised\n"); #endif @@ -179,7 +179,7 @@ void *TickerData::GameThreadMain(void * /* p */) data->drawtick.Push(0); -#if LOL_DEBUG +#if LOL_BUILD_DEBUG Log::Info("ticker game thread terminated\n"); #endif @@ -190,7 +190,7 @@ void *TickerData::GameThreadMain(void * /* p */) #if LOL_FEATURE_THREADS void *TickerData::DrawThreadMain(void * /* p */) { -#if LOL_DEBUG +#if LOL_BUILD_DEBUG Log::Info("ticker draw thread initialised\n"); #endif @@ -205,7 +205,7 @@ void *TickerData::DrawThreadMain(void * /* p */) data->gametick.Push(1); } -#if LOL_DEBUG +#if LOL_BUILD_DEBUG Log::Info("ticker draw thread terminated\n"); #endif @@ -268,7 +268,7 @@ void TickerData::GameThreadTick() data->bias = 0.f; } -#if LOL_DEBUG +#if LOL_BUILD_DEBUG data->keepalive += data->deltatime; if (data->keepalive > 10.f) { @@ -290,14 +290,14 @@ void TickerData::GameThreadTick() for (Entity *e = data->list[i]; e && n < data->panic; e = e->m_gamenext) if (e->m_ref) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE Log::Error("poking %s\n", e->GetName()); #endif e->m_ref--; n++; } -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (n) Log::Error("%i entities stuck after %i frames, poked %i\n", data->nentities, data->quitdelay, n); @@ -358,14 +358,14 @@ void TickerData::GameThreadTick() for (Entity *e = data->list[i]; e; e = e->m_gamenext) if (!e->m_destroy) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (e->m_tickstate != Entity::STATE_IDLE) Log::Error("entity %s [%p] not idle for game tick\n", e->GetName(), e); e->m_tickstate = Entity::STATE_PRETICK_GAME; #endif e->TickGame(data->deltatime); -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (e->m_tickstate != Entity::STATE_POSTTICK_GAME) Log::Error("entity %s [%p] missed super game tick\n", e->GetName(), e); @@ -400,14 +400,14 @@ void TickerData::DrawThreadTick() for (Entity *e = data->list[i]; e; e = e->m_drawnext) if (!e->m_destroy) { -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (e->m_tickstate != Entity::STATE_IDLE) Log::Error("entity %s [%p] not idle for draw tick\n", e->GetName(), e); e->m_tickstate = Entity::STATE_PRETICK_DRAW; #endif e->TickDraw(data->deltatime); -#if !LOL_RELEASE +#if !LOL_BUILD_RELEASE if (e->m_tickstate != Entity::STATE_POSTTICK_DRAW) Log::Error("entity %s [%p] missed super draw tick\n", e->GetName(), e); diff --git a/test/unit/build.cpp b/test/unit/build.cpp index ffddc14a..7f418a60 100644 --- a/test/unit/build.cpp +++ b/test/unit/build.cpp @@ -127,7 +127,7 @@ LOLUNIT_FIXTURE(BuildTest) LOLUNIT_ASSERT_EQUAL(sizeof(u64mat4), 128); } -#if !defined LOL_DEBUG +#if !defined LOL_BUILD_DEBUG LOLUNIT_TEST(FastMath) { double x, y;