Browse Source

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.
Peter Kokot 1 year ago
parent
commit
3ffc8a6b61
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Modules/FindBISON.cmake

+ 2 - 1
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)