Hash :
22cbd038
Author :
Date :
2021-09-14T12:34:25
[meson] Add ragel subproject If ragel 6.10 is not found, build it from source. Seems to work, except that ragel uses exceptions and we configure HarfBuzz build to not use exceptions, and I can’t find away to enable exceptions only for the ragel subproject. I had to remove cpp_eh=none from default options and try to disable exceptions in MSVC manually (other compilers are already handled).
#!/usr/bin/env python3
"This tool is intended to be used from meson"
import os, os.path, sys, subprocess, shutil
ragel = sys.argv[1]
if not ragel:
sys.exit ('You have to install ragel if you are going to develop HarfBuzz itself')
if len (sys.argv) < 4:
sys.exit (__doc__)
OUTPUT = sys.argv[2]
CURRENT_SOURCE_DIR = sys.argv[3]
INPUT = sys.argv[4]
outdir = os.path.dirname (OUTPUT)
shutil.copy (INPUT, outdir)
rl = os.path.basename (INPUT)
hh = rl.replace ('.rl', '.hh')
subprocess.Popen (ragel.split() + ['-e', '-F1', '-o', hh, rl], cwd=outdir).wait ()
# copy it also to src/
shutil.copyfile (os.path.join (outdir, hh), os.path.join (CURRENT_SOURCE_DIR, hh))