blt
blt copied to clipboard
Modify behavior of `blt_list_append` ?
The Axom project recently fixed a bug related to ENV
variables that were not correctly setup -- https://github.com/LLNL/axom/pull/1168
It revealed that blt_list_append
generates a FATAL_ERROR
when attempting to append empty strings to a list.
https://github.com/LLNL/blt/blob/d57f7995ff8299e4612e74ec94e35eacde93cf40/cmake/BLTInstallableMacros.cmake#L40-L42
Is this the desired behavior? Or would it be better if appending an empty string to a list was a no-op?
Ben Liu suggested some additional options:
-
blt_list_append
should emit a warning in this case since this is often unexpected behavior -
blt_list_append
should take an (optional) additional parameter regarding how to treat this case, e.g.FATAL_ERROR
, warning or no-op. If we pursue this option, we'd also need to decide on the default behavior.
@white238 noted that CMake's (list(APPEND <empty string>)
is a no-op