diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2019-10-11 13:42:06 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2019-10-11 12:02:08 +0000 |
commit | f2d15b9683c58755cf53250ca30fa60b9c4eb215 (patch) | |
tree | 57e3c1327533e9494d38abb4b1dddae5cc206e20 /cmake | |
parent | 1dd82a88438a8e76bc25c5ef122a3b6afa0bcbdf (diff) |
Minor fix to qt_process_qlalr API
It's probably best to make it follow the usual calling convention that
the associated (consuming) target is the first parameter of the
function. So first this change accepts both formats.
Change-Id: I1f20706b23d5e819e0eb689eecedb3afb49df3b7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 2e29eec8e5..8c9e9bcd8f 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -3182,7 +3182,15 @@ endfunction() # Generate a few output files using qlalr, and assign those to 'consuming_target'. # 'input_file_list' is a list of 'foo.g' file paths. # 'flags' are extra flags to be passed to qlalr. -function(qt_process_qlalr input_file_list consuming_target flags) +function(qt_process_qlalr consuming_target input_file_list flags) + # For compatibility, swap parameters if called from an old call site. + if (NOT TARGET "${consuming_target}") + set(tmp "${consuming_target}") + set(consuming_target "${input_file_list}") + set(input_file_list "${tmp}") + unset(tmp) + endif() + foreach(input_file ${input_file_list}) file(STRINGS ${input_file} input_file_lines) qt_qlalr_find_option_in_list("${input_file_lines}" "^%parser(.+)" "parser") |