Skip to content
This repository has been archived by the owner on Apr 3, 2022. It is now read-only.

Commit

Permalink
Add optional param to compile for console
Browse files Browse the repository at this point in the history
  • Loading branch information
spikespaz committed Aug 19, 2019
1 parent aebb96c commit 3cdacc4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,18 @@ def delete_directory(directory):
rmtree(directory, ignore_errors=True)


def compile_file(source, binary, debug=True):
def compile_file(source, binary, debug=True, console=False):
log_print("Compiling binary: " + binary)

command = ["ldc2", source, "-i", "-I", dirname(source), "-J", VARS_PATH, "-of", binary, "-m32"]

if debug:
command.extend(["-gc", "-d-debug", "-L/subsystem:console"])
else:
command.extend(
["-O3", "-ffast-math", "-release", "-L/subsystem:windows", "-L/entry:mainCRTStartup"]
)
command.extend(["-O3", "-ffast-math", "-release"])

if not console:
command.extend(["-L/subsystem:windows", "-L/entry:mainCRTStartup"])

log_print(">", *command)
call(command)
Expand Down Expand Up @@ -189,7 +190,7 @@ def copy_files(version):
log_print("Building updater binary: " + UPDATER_BIN)

copy_files(ARGS.version)
compile_file(SOURCE_PATH + "/updater.d", UPDATER_BIN, ARGS.debug)
compile_file(SOURCE_PATH + "/updater.d", UPDATER_BIN, ARGS.debug, console=True)

add_icon(UPDATER_BIN)

Expand Down

0 comments on commit 3cdacc4

Please sign in to comment.