CMake + Ninja cannot use response files when building with IAR
When the use of response files are enabled by setting CMAKE_C_USE_RESPONSE_FILES_FOR_OBJECTS and CMAKE_NINJA_FORCE_RESPONSE_FILE, an otherwise clean building project fails with Fatal error[Su011]: More than one source file specified.
This is using CMake 3.14.0-rc1 and Ninja 1.9.0
c:\code\fcc13xx\build_ninja_test>cmake .. -G Ninja -DCMAKE_C_USE_RESPONSE_FILES_FOR_OBJECTS=1 -DCMAKE_NINJA_FORCE_RESPONSE_FILE=1
-- The C compiler identification is IAR 7.50.3
-- The ASM compiler identification is IAR 7.50.3
-- Found assembler: C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.3/arm/bin/iasmarm.exe
-- Check for working C compiler: C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.3/arm/bin/iccarm.exe
-- Check for working C compiler: C:/Program Files (x86)/IAR Systems/Embedded Workbench 7.3/arm/bin/iccarm.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_C_USE_RESPONSE_FILES_FOR_OBJECTS
CMAKE_NINJA_FORCE_RESPONSE_FILE
-- Build files have been written to: C:/code/fcc13xx/build_ninja_test
c:\code\fcc13xx\build_ninja_test>ninja
[0/1] Re-running CMake...
-- Configuring done
-- Generating done
-- Build files have been written to: C:/code/fcc13xx/build_ninja_test
[1/2] Building C object CMakeFiles\demo.dir\demo.c.o
FAILED: CMakeFiles/demo.dir/demo.c.o
C:\PROGRA~2\IARSYS~1\EMBEDD~1.3\arm\bin\iccarm.exe --silent ..\demo.c @CMakeFiles\demo.dir\demo.c.o.rsp --dependencies=ns CMakeFiles\demo.dir\demo.c.o.d -o CMakeFiles\demo.dir\demo.c.o
IAR ANSI C/C++ Compiler V7.50.3.10732/W32 for ARM
Copyright 1999-2016 IAR Systems AB.
Fatal error[Su011]: More than one source file specified:
..\demo.c
@CMakeFiles\demo.dir\demo.c.o.rsp
Fatal error detected, aborting.
ninja: build stopped: subcommand failed.