From 649baf052f5a2738b068cba825a4b1cf7845090f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 27 Jan 2023 15:20:02 +0530 Subject: [PATCH] Nicer error formatting when cross compiling --- setup/build.py | 2 ++ setup/installers.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/setup/build.py b/setup/build.py index cf7dac88a9..6a3641577c 100644 --- a/setup/build.py +++ b/setup/build.py @@ -309,6 +309,8 @@ def init_env(debug=False, sanitize=False, compiling_for='native'): cc = cxx = 'clang-cl' linker = 'lld-link' splat = '.build-cache/xwin/splat' + cflags.append('-fcolor-diagnostics') + cflags.append('-fansi-escape-codes') for I in 'sdk/include/um sdk/include/cppwinrt sdk/include/shared sdk/include/ucrt crt/include'.split(): cflags.append('/external:I') cflags.append(f'{splat}/{I}') diff --git a/setup/installers.py b/setup/installers.py index 6d63edaf46..6a13e9491c 100644 --- a/setup/installers.py +++ b/setup/installers.py @@ -239,7 +239,9 @@ class ExtDev(Command): which, ext = opts.cli_args[:2] cmd = opts.cli_args[2:] or ['calibre-debug', '--test-build'] if which == 'windows': - subprocess.check_call([sys.executable, 'setup.py', 'build', '--cross-compile-extensions=windows', '--only=winspeech']) + cp = subprocess.run([sys.executable, 'setup.py', 'build', '--cross-compile-extensions=windows', '--only=winspeech']) + if cp.returncode != 0: + raise SystemExit(cp.returncode) src = 'src/calibre/plugins/winspeech.cross-windows-x64.pyd' host = 'win' path = '/cygdrive/c/Program Files/Calibre2/app/bin/{}.pyd'