From 2ffe372bddf028bd5eccc164854d4d2e86d4b14a Mon Sep 17 00:00:00 2001 From: Mathieu Duponchelle Date: Thu, 24 Jan 2019 17:11:59 +0100 Subject: [PATCH] windows: unconditionally use flex / bison binaries This to simplify the checks made when for example a flex binary is available system wide: the build process was failing when that system wide binary didn't have the required version. Instead of adding more checks and making things more complex, let's just always use our binary subproject. --- meson.build | 5 +--- .../win-flex-bison-binaries/meson.build | 29 +++++++------------ 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/meson.build b/meson.build index 66dec30328..02af00aa31 100644 --- a/meson.build +++ b/meson.build @@ -55,10 +55,7 @@ os.symlink(os.path.join('@1@', 'subprojects', '@0@'), os.path.join('@1@', '@0@')) ''' -# On Windows, if flex/bison aren't found, we use a subproject to get them -flex = find_program('flex', 'win_flex', required : build_system != 'windows') -bison = find_program('bison', 'win_bison', required : build_system != 'windows') -if not flex.found() or not bison.found() +if build_system == 'windows' subproject('win-flex-bison-binaries') endif diff --git a/subprojects/win-flex-bison-binaries/meson.build b/subprojects/win-flex-bison-binaries/meson.build index e56fea73c6..4179265c7f 100644 --- a/subprojects/win-flex-bison-binaries/meson.build +++ b/subprojects/win-flex-bison-binaries/meson.build @@ -1,25 +1,16 @@ project('win-flex-bison-binary', version : '2.5.14') -provide_flex = not find_program('flex', required : false).found() -provide_bison = not find_program('bison', required : false).found() +py3 = import('python3').find_python() -if provide_flex or provide_bison - py3 = import('python3').find_python() +message('Downloading and extracting win-flex-bison binaries...') - message('Downloading and extracting win-flex-bison binaries...') +zip_hash = '354c9aae02aca421c52abfda7fe3ce6c32ad07e25ff3f66e31da9437a0b906cf' - zip_hash = '354c9aae02aca421c52abfda7fe3ce6c32ad07e25ff3f66e31da9437a0b906cf' - - ret = run_command(py3, files('download-binary.py'), meson.project_version(), zip_hash) - if ret.returncode() != 0 - message(ret.stdout()) - error(ret.stderr()) - endif - - if provide_flex - meson.override_find_program('flex', find_program('win_flex')) - endif - if provide_bison - meson.override_find_program('bison', find_program('win_bison')) - endif +ret = run_command(py3, files('download-binary.py'), meson.project_version(), zip_hash) +if ret.returncode() != 0 + message(ret.stdout()) + error(ret.stderr()) endif + +meson.override_find_program('flex', find_program('win_flex')) +meson.override_find_program('bison', find_program('win_bison'))