From 4ce24ff9da0f6551eeca2011dc9d05194bf02e12 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 24 Sep 2016 14:27:04 -0400 Subject: genunicodetables: Give the unicode directory as the first argument Let genunicodetables determine which files it needs from the unicode directory. cmake just needs to pass the directory and destination file to the script. --- scripts/genunicodetables.lua | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/genunicodetables.lua b/scripts/genunicodetables.lua index f66f738659..66430ba26e 100644 --- a/scripts/genunicodetables.lua +++ b/scripts/genunicodetables.lua @@ -17,18 +17,22 @@ -- which don't have ambiguous or double width, and emoji_all has all Emojis. if arg[1] == '--help' then print('Usage:') - print(' genunicodetables.lua UnicodeData.txt CaseFolding.txt ' .. - 'EastAsianWidth.txt emoji-data.txt') - print(' unicode_tables.generated.h') + print(' genunicodetables.lua unicode/ unicode_tables.generated.h') os.exit(0) end -local unicodedata_fname = arg[1] -local casefolding_fname = arg[2] -local eastasianwidth_fname = arg[3] -local emoji_fname = arg[4] +local basedir = arg[1] +local pathsep = package.config:sub(1, 1) +local get_path = function(fname) + return basedir .. pathsep .. fname +end + +local unicodedata_fname = get_path('UnicodeData.txt') +local casefolding_fname = get_path('CaseFolding.txt') +local eastasianwidth_fname = get_path('EastAsianWidth.txt') +local emoji_fname = get_path('emoji-data.txt') -local utf_tables_fname = arg[5] +local utf_tables_fname = arg[2] local split_on_semicolons = function(s) local ret = {} -- cgit