From dd552dc8d79e806974a91478d2bb5abce590a5cd Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Sun, 18 Apr 2021 14:06:33 +0200 Subject: [PATCH] Print the Wine version at Meson configure time --- CHANGELOG.md | 8 ++++++++ meson.build | 21 +++++++++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a840318..e4df291e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- When building the package from source, the targetted Wine version gets printed + at configure-time. This can make it a bit easier to diagnose Wine-related + compilation issues. + ## [3.1.0] - 2021-04-15 ### Added diff --git a/meson.build b/meson.build index 45d985f2..8a5da63f 100644 --- a/meson.build +++ b/meson.build @@ -68,14 +68,23 @@ endif # convention to be specified on the `main()` functions or else `argc` and `argv` # will point to the wrong memory. Similarly, with other versions of Wine this # should _not_ be specified for the same reason. We'll try to figure out the -# current Wine version and add this calling convention based on that. +# current Wine version and add this calling convention based on that. Also, +# printing the configure-time Wine version might be useful in diagnosing build +# issues so we'll do just that. The regexp looks a bit weird because of the +# lookahead. That's purely for aesthetics so we don't end up printing trailing +# dots when parsing Wine version strings like `wine-6.4.r0.g7ec998e1 ( TkG Staging Esync Fsync )`. # # https://bugs.winehq.org/show_bug.cgi?id=49138 -wine_version = run_command('sh', '-c', '''wine --version | grep --only-matching -E '[0-9]+\.[0-9.]+' | head -n1''') -if wine_version.returncode() == 0 and \ - wine_version.stdout().version_compare('>=5.7') and \ - wine_version.stdout().version_compare('<6.0') - compiler_options += '-DWINE_USE_CDECL' +wine_version = run_command('sh', '-c', '''wine --version | grep --only-matching -P '[0-9]+\.[0-9.]+?(?=\.)?' | head -n1''') +if wine_version.returncode() == 0 + message('Targetting Wine @0@'.format(wine_version.stdout())) + if wine_version.stdout().version_compare('>=5.7') and \ + wine_version.stdout().version_compare('<6.0') + message('- Using the cdecl calling convention') + compiler_options += '-DWINE_USE_CDECL' + endif +else + warning('Unable to determine the current Wine version') endif # Wine versions below 5.7 will segfault in `CoCreateGuid` which gets called