From 3ffc8a6b613e5b31ed75d25b28b86a5ebabdf9ce Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sun, 20 Oct 2024 15:36:17 +0200 Subject: [PATCH] FindBISON: Add COMMAND_EXPAND_LISTS to remove empty arguments 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 GNU bison command-line tool errors out with `/usr/bin/bison: extra operand` error. This removes empty arguments from the created bison command. --- Modules/FindBISON.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index 3515bf0ddd..6d0ace7aad 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -281,7 +281,8 @@ if(BISON_EXECUTABLE) VERBATIM DEPENDS ${_BisonInput} COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}" - WORKING_DIRECTORY ${_BISON_WORKING_DIRECTORY}) + WORKING_DIRECTORY ${_BISON_WORKING_DIRECTORY} + COMMAND_EXPAND_LISTS) unset(_BISON_WORKING_DIRECTORY)