[CMake] Problem with forced response files (Ninja)

Gößwein Matthias / eeas gmbh matthias.goesswein at eeas.at
Mon Oct 30 17:13:20 EDT 2017


Hello,

I'm currently trying to add support for the Tasking Compiler to CMake.
Actually i  have a working solution (without response files), but if i
want to use response files, then i have a problem. The Tasking compiler
expects "-f" as a flag instead of "@".

I use the ninja generator and have set the following variables:

SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1)
SET(CMAKE_C_RESPONSE_FILE_LINK_FLAG "-f")
SET(CMAKE_NINJA_FORCE_RESPONSE_FILE 1) # I'd like to force it

But during Compiler Detection phase i get an error because CMake uses
still the "@" as a flog for the response files:

-- Check for working C compiler: D:/Projects/Tools/Tasking/01_00_00/ctc/bin/cctc.exe -- broken
CMake Error at D:/Projects/Tools/CMake/03_01_00/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "D:/Projects/Tools/Tasking/01_00_00/ctc/bin/cctc.exe" is not
  able to compile a simple test program.

  It fails with the following output:

   Change Dir: D:/Projects/Software/Projects/EC23MA/Trunk/EC23MA/Gen/CMakeFiles/CMakeTmp



  Run Build Command:"D:/Projects/Tools/Ninja/01_00_00/ninja.exe" "cmTC_31d94"

  [1/2] Building C object CMakeFiles\cmTC_31d94.dir\testCCompiler.c.o

  FAILED: CMakeFiles/cmTC_31d94.dir/testCCompiler.c.o

  cmd.exe /C "D:\Projects\Tools\Tasking\01_00_00\ctc\bin\cctc.exe -c
  testCCompiler.c *@**CMakeFiles\cmTC_31d94.dir\testCCompiler.c.o.rsp*
  --dep-file=CMakeFiles\cmTC_31d94.dir\testCCompiler.c.o.d
  -Wc--make-target=CMakeFiles\cmTC_31d94.dir\testCCompiler.c.o -o
  CMakeFiles\cmTC_31d94.dir\testCCompiler.c.o &&
  "d:/Projects/Tools/CMake/03_01_00/bin/cmake.exe"
  -DDEPFILE="CMakeFiles\cmTC_31d94.dir\testCCompiler.c.o.d"
  -DOBJECT="CMakeFiles\cmTC_31d94.dir\testCCompiler.c.o" -P
  "D:/Projects/Software/Projects/EC23MA/Trunk/EC23MA/Gen/CMakeFiles/CMakeTmp/ninja_tasking_depfile_workaround.cmake""


  cctc E205: don't know what to do with
  @CMakeFiles\cmTC_31d94.dir\testCCompiler.c.o.rsp

  ninja: build stopped: subcommand failed.

Is there any other variable which i should set or is this a CMake issue?

Best regards,
Matthias Goesswein

-- 
Matthias Goesswein

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171030/e1b2eaec/attachment.html>


More information about the CMake mailing list