From 80c9ef37d7ab4d3687537ffe12630f1920673c9a Mon Sep 17 00:00:00 2001 From: nillerusr Date: Wed, 16 Nov 2022 13:52:52 +0300 Subject: [PATCH] Add cflags/ldflags, SDL version to engine.log --- launcher/android/main.cpp | 8 +------- launcher/launcher.cpp | 9 ++++++++- launcher/wscript | 2 ++ tier0/dbg.cpp | 6 ++++++ tier0/wscript | 2 ++ 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/launcher/android/main.cpp b/launcher/android/main.cpp index baf9f9ef..e044ae6c 100644 --- a/launcher/android/main.cpp +++ b/launcher/android/main.cpp @@ -20,7 +20,6 @@ GNU General Public License for more details. #include #include #include -#include #include "tier0/dbg.h" #include "tier0/threadtools.h" @@ -29,7 +28,6 @@ char java_args[4096]; int iLastArgs = 0; DLL_EXPORT int LauncherMain( int argc, char **argv ); // from launcher.cpp -extern void InitCrashHandler(); DLL_EXPORT int Java_com_valvesoftware_ValveActivity2_setenv(JNIEnv *jenv, jclass *jclass, jstring env, jstring value, jint over) { @@ -120,18 +118,14 @@ void android_property_print(const char *name) DLL_EXPORT int LauncherMainAndroid( int argc, char **argv ) { - SDL_version ver; - SDL_GetVersion( &ver ); + Msg("GetTotalMemory() = %.2f \n", GetTotalMemory()); - Msg("SDL version: %d.%d.%d rev: %s\n", (int)ver.major, (int)ver.minor, (int)ver.patch, SDL_GetRevision()); - Msg("GetTotalMemory() = %.2f GiB\n", GetTotalMemory()); android_property_print("ro.build.version.sdk"); android_property_print("ro.product.device"); android_property_print("ro.product.manufacturer"); android_property_print("ro.product.model"); android_property_print("ro.product.name"); - InitCrashHandler(); SetLauncherArgs(); SDL_SetHint(SDL_HINT_TOUCH_MOUSE_EVENTS, "0"); diff --git a/launcher/launcher.cpp b/launcher/launcher.cpp index 47e69f93..1a5285a9 100644 --- a/launcher/launcher.cpp +++ b/launcher/launcher.cpp @@ -67,7 +67,8 @@ #endif #if defined( USE_SDL ) -#include "SDL.h" +#include +#include #if !defined( _WIN32 ) #define MB_OK 0x00000001 @@ -1218,6 +1219,12 @@ DLL_EXPORT int LauncherMain( int argc, char **argv ) #endif // LINUX +#ifdef USE_SDL + SDL_version ver; + SDL_GetVersion( &ver ); + Msg("SDL version: %d.%d.%d rev: %s\n", (int)ver.major, (int)ver.minor, (int)ver.patch, SDL_GetRevision()); +#endif + #if defined LINUX && defined USE_SDL && defined TOGLES && !defined ANDROID SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1"); #endif diff --git a/launcher/wscript b/launcher/wscript index bba9c9a6..8bd7dad3 100755 --- a/launcher/wscript +++ b/launcher/wscript @@ -13,6 +13,8 @@ def options(opt): def configure(conf): conf.define('LAUNCHERONLY',1) + conf.define('CFLAGS', conf.env.CFLAGS) + conf.define('LDFLAGS', conf.env.LINKFLAGS) def build(bld): source = [ diff --git a/tier0/dbg.cpp b/tier0/dbg.cpp index 8ea5b36f..519a0f05 100644 --- a/tier0/dbg.cpp +++ b/tier0/dbg.cpp @@ -114,6 +114,12 @@ void CDbgLogger::Init(const char *logfile) #else fprintf(file, ">>> Engine(arch:%s) started at %s\n", GetProcessorArchName(), szTime); #endif + +#ifdef GNUC + fprintf(file, "Compiler version: %s\n", __VERSION__); +#endif + fprintf(file, "Compiler CFLAGS: %s\n", WAF_CFLAGS); + fprintf(file, "Compiler LDFLAGS: %s\n", WAF_LDFLAGS); fflush(file); for( int i = 0; i < iMsg; i++ ) diff --git a/tier0/wscript b/tier0/wscript index 1f0a9f34..b02c60bf 100755 --- a/tier0/wscript +++ b/tier0/wscript @@ -12,6 +12,8 @@ def options(opt): return def configure(conf): + conf.define('WAF_CFLAGS', conf.env.CFLAGS) + conf.define('WAF_LDFLAGS', conf.env.LINKFLAGS) conf.define('TIER0_DLL_EXPORT',1) # conf.define('NO_HOOK_MALLOC',1)