Interprocedural optimization fails when toolchain path contains spaces
The GCC ARM Embedded toolchain (arm-none-eabi-gcc
) installs by default to, e.g., C:/Program Files (x86)/GNU Tools ARM Embedded/6.2 2016q4/
on Windows. It seems like the one of the steps in the interprocedural optimization build fails because this path isn't properly escaped:
Failing command (abbreviated):
$ cmake -GNinja -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON ..
...
-- The C compiler identification is GNU 6.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Program Files (x86)/GNU Tools ARM Embedded/6.2 2016q4/bin/arm-none-eabi-gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/GNU Tools ARM Embedded/6.2 2016q4/bin/arm-none-eabi-gcc.exe
-- Check for working C compiler: C:/Program Files (x86)/GNU Tools ARM Embedded/6.2 2016q4/bin/arm-none-eabi-gcc.exe
-- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
...
$ ninja
...
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E remove <path-to-mylib>.a && C:/Program Files (x86)/GNU Tools ARM Embedded/6.2 2016q4/bin/arm-none-eabi-gcc-ar.exe cr <path-to-mylib>.a
...