FindFlex: Add COMMAND_EXPAND_LISTS to remove empty arguments

This is a follow-up of 3ffc8a6b61

When using generator expressions in the COMPILE_FLAGS argument, and the
generator expression expands to an empty string, command gets an empty
argument with double quotes where flex command-line tool errors out
with `/usr/bin/flex: can't open` error. This removes empty arguments
from the created flex command.
This commit is contained in:
Peter Kokot
2024-12-22 00:11:28 +01:00
parent c94cd43584
commit 1310d43380

View File

@@ -217,7 +217,8 @@ if(FLEX_EXECUTABLE)
VERBATIM
DEPENDS ${_flex_INPUT}
COMMENT "[FLEX][${Name}] Building scanner with ${_flex_EXE_NAME_WE} ${FLEX_VERSION}"
WORKING_DIRECTORY ${_flex_WORKING_DIR})
WORKING_DIRECTORY ${_flex_WORKING_DIR}
COMMAND_EXPAND_LISTS)
set(FLEX_${Name}_DEFINED TRUE)
set(FLEX_${Name}_OUTPUTS ${_flex_TARGET_OUTPUTS})