Merge pull request #14881 from vit9696/macdebug

Improve Xcode debugging support
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2021-09-19 11:58:30 +02:00
commit cea177ca32
2 files changed
+11

No files matched your search

+4
View File
@@ -69,6 +69,10 @@ ConsoleListener::ConsoleListener() : bHidden(true)
bUseColor = false;
#elif defined(_MSC_VER)
bUseColor = false;
#elif defined(__APPLE__)
// Xcode builtin terminal used for debugging does not support colours.
// Fortunately it can be detected with a TERM env variable.
bUseColor = isatty(fileno(stdout)) && getenv("TERM") != NULL;
#else
bUseColor = isatty(fileno(stdout));
#endif
+7
View File
@@ -612,6 +612,13 @@ void NativeInit(int argc, const char *argv[], const char *savegame_dir, const ch
for (int i = 1; i < argc; i++) {
if (argv[i][0] == '-') {
#if defined(__APPLE__)
// On Apple system debugged executable may get -NSDocumentRevisionsDebugMode YES in argv.
if (!strcmp(argv[i], "-NSDocumentRevisionsDebugMode") && argc - 1 > i) {
i++;
continue;
}
#endif
switch (argv[i][1]) {
case 'd':
// Enable debug logging