Remix.run Logo
colejohnson66 3 days ago

CMake is entirely stringly-typed as well. Like many shells, arrays/lists are just space-separated strings.

mdaniel 2 days ago | parent [-]

Pedantically that's not true, they're ';' delimited https://cmake.org/cmake/help/v3.31/command/list.html#:~:text...

The confusion comes from the fact that set() automatically coerces space-delimited items into a ;-delimited list

  set(ONE alpha;beta)
  set(TWO alpha beta)
  list(LENGTH ONE one_len)
  list(LENGTH TWO two_len)
  message(FATAL_ERROR "one <<${ONE}>> length ${one_len}\ntwo <<${TWO}>> length ${two_len}")
emits

  one <<alpha;beta>> length 2

  two <<alpha;beta>> length 2