Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions main/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Import("env")

import main_builders
import sys
import os

env.main_sources = []

Expand Down Expand Up @@ -36,3 +38,16 @@ env_main.CommandNoCache(

lib = env_main.add_library("main", env.main_sources)
env.Prepend(LIBS=[lib])

build_args = " ".join(sys.argv[1:])

SCONSFLAGS = os.environ.get("SCONSFLAGS")
if SCONSFLAGS:
build_args = SCONSFLAGS + " " + build_args

with open("build_arguments.gen.h", "w") as fd:
fd.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
fd.write("#ifndef BUILD_ARGUMENTS_GEN_H\n")
fd.write("#define BUILD_ARGUMENTS_GEN_H\n")
fd.write('#define BUILD_ARGUMENTS "' + build_args + '"\n')
fd.write("#endif // BUILD_ARGUMENTS_GEN_H\n")
6 changes: 6 additions & 0 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include "core/version_hash.gen.h"
#include "drivers/register_driver_types.h"
#include "main/app_icon.gen.h"
#include "main/build_arguments.gen.h"
#include "main/main_timer_sync.h"
#include "main/performance.h"
#include "main/splash.gen.h"
Expand Down Expand Up @@ -647,6 +648,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
print_line(get_full_version_string());
goto error;

} else if (I->get() == "--build-info") {
print_line(get_full_version_string());
print_line("Build arguments: " + String(BUILD_ARGUMENTS));
Comment thread
Anutrix marked this conversation as resolved.
Outdated
goto error;

} else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output

OS::get_singleton()->_verbose_stdout = true;
Expand Down