Skip to content
Verified Commit d81089b1 authored by Alex Turbov's avatar Alex Turbov
Browse files

cmake.xml: improve the generator to produce optimized regexes

Split strings containing `<variadic_part>` by `_` char and build
a tree of name components. Having this tree it's possible to reduce
common parts of regular expressions and transform the remainder into
an alt group. For example, the following list of variables to match

    CMAKE_<some>_ONE
    CMAKE_<some>_TWO
    CMAKE_<some>_BLAH_SATU
    CMAKE_<some>_BLAH_DUA

give the following regex to match:

    CMAKE_&var_ref;_(BLAH_(SATU|DUA)|ONE|TWO)

instead of naive way used before:

    CMAKE_&var_ref;_ONE|CMAKE_&var_ref;_TWO|CMAKE_&var_ref;_BLAH_SATU|CMAKE_&var_ref;_BLAH_DUA

Also, add some features missed before.
parent a0748a46
Pipeline #450414 passed with stage
in 9 minutes and 14 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment