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.
This commit is contained in:
James McCoy 2016-09-24 14:27:04 -04:00
parent 9e1c659666
commit 4ce24ff9da
No known key found for this signature in database
GPG Key ID: DFE691AE331BA3DB
2 changed files with 15 additions and 20 deletions

View File

@ -17,18 +17,22 @@
-- which don't have ambiguous or double width, and emoji_all has all Emojis. -- which don't have ambiguous or double width, and emoji_all has all Emojis.
if arg[1] == '--help' then if arg[1] == '--help' then
print('Usage:') print('Usage:')
print(' genunicodetables.lua UnicodeData.txt CaseFolding.txt ' .. print(' genunicodetables.lua unicode/ unicode_tables.generated.h')
'EastAsianWidth.txt emoji-data.txt')
print(' unicode_tables.generated.h')
os.exit(0) os.exit(0)
end end
local unicodedata_fname = arg[1] local basedir = arg[1]
local casefolding_fname = arg[2] local pathsep = package.config:sub(1, 1)
local eastasianwidth_fname = arg[3] local get_path = function(fname)
local emoji_fname = arg[4] return basedir .. pathsep .. fname
end
local utf_tables_fname = arg[5] 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[2]
local split_on_semicolons = function(s) local split_on_semicolons = function(s)
local ret = {} local ret = {}

View File

@ -36,10 +36,7 @@ set(EVAL_DEFS_FILE ${PROJECT_SOURCE_DIR}/src/nvim/eval.lua)
set(OPTIONS_LIST_FILE ${PROJECT_SOURCE_DIR}/src/nvim/options.lua) set(OPTIONS_LIST_FILE ${PROJECT_SOURCE_DIR}/src/nvim/options.lua)
set(UNICODE_TABLES_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genunicodetables.lua) set(UNICODE_TABLES_GENERATOR ${PROJECT_SOURCE_DIR}/scripts/genunicodetables.lua)
set(UNICODE_DIR ${PROJECT_SOURCE_DIR}/unicode) set(UNICODE_DIR ${PROJECT_SOURCE_DIR}/unicode)
set(UNICODEDATA_FILE ${UNICODE_DIR}/UnicodeData.txt) file(GLOB UNICODE_FILES ${UNICODE_DIR}/*.txt)
set(CASEFOLDING_FILE ${UNICODE_DIR}/CaseFolding.txt)
set(EASTASIANWIDTH_FILE ${UNICODE_DIR}/EastAsianWidth.txt)
set(EMOJI_FILE ${UNICODE_DIR}/emoji-data.txt)
set(GENERATED_UNICODE_TABLES ${GENERATED_DIR}/unicode_tables.generated.h) set(GENERATED_UNICODE_TABLES ${GENERATED_DIR}/unicode_tables.generated.h)
include_directories(${GENERATED_DIR}) include_directories(${GENERATED_DIR})
@ -193,17 +190,11 @@ endforeach()
add_custom_command(OUTPUT ${GENERATED_UNICODE_TABLES} add_custom_command(OUTPUT ${GENERATED_UNICODE_TABLES}
COMMAND ${LUA_PRG} ${UNICODE_TABLES_GENERATOR} COMMAND ${LUA_PRG} ${UNICODE_TABLES_GENERATOR}
${UNICODEDATA_FILE} ${UNICODE_DIR}
${CASEFOLDING_FILE}
${EASTASIANWIDTH_FILE}
${EMOJI_FILE}
${GENERATED_UNICODE_TABLES} ${GENERATED_UNICODE_TABLES}
DEPENDS DEPENDS
${UNICODE_TABLES_GENERATOR} ${UNICODE_TABLES_GENERATOR}
${UNICODEDATA_FILE} ${UNICODE_FILES}
${CASEFOLDING_FILE}
${EASTASIANWIDTH_FILE}
${EMOJI_FILE}
) )
add_custom_command(OUTPUT ${GENERATED_API_DISPATCH} ${API_METADATA} add_custom_command(OUTPUT ${GENERATED_API_DISPATCH} ${API_METADATA}