CMAKE_<LANG>_FLAGS is not interpreted properly as a commandline snippet in CMakeDeterminteCompilerId
I have a toolchain file where I have to set a flag that's required to use the compiler at all, and it contains spaces. According to the docs (https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_FLAGS.html):
This value is a command-line string fragment. Therefore, multiple options should be separated by spaces, and options with spaces should be quoted.
However, it seems like all the spaces get replace with semicolons in CMakeDeterminteCompilerId.cmake:33 -- it works for me to replace that with
separate_arguments(CMAKE_${lang}_COMPILER_ID_FLAGS_LIST NATIVE_COMMAND "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
Is this an acceptable solution? I'm happy to open a MR.
PS: this issue also seems to be reported at https://stackoverflow.com/questions/63455763/cmake-cxx-flags-treats-every-space-as-a-delimiter-for-compiler-flags-and-spaces
Edited by Brad King