Nicer error formatting when cross compiling

This commit is contained in:
Kovid Goyal 2023-01-27 15:20:02 +05:30
parent 039b684269
commit 649baf052f
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View File

@ -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}')

View File

@ -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'