[cmake-developers] CMAKE :: mingw make files with response file for includes

Jayakumar, Lenindarbi Lenindarbi.Jayakumar at magna.com
Wed Apr 11 12:25:26 EDT 2018


Hi Brad,
Is the below issue solved in latest release 3.11.0 ?
Could you please confirm?



Grüße
Lenin

-----Original Message-----
From: Jayakumar, Lenindarbi
Sent: Freitag, 19. Januar 2018 15:26
To: 'Brad King' <brad.king at kitware.com>; cmake-developers at cmake.org
Subject: RE: [cmake-developers] CMAKE :: mingw make files with response file for includes

Thanks for the reply.

It is not compiler and linker.
I have to use response file for both includes and objects.
Tasking compiler expects -f as Response file link flag for both. But cmake produces command line for objects using -f and includes using @.

I prefer to get it fixed in generator. Unfortunately I don't have enough time and experience.
Perhaps an cmake expert could confirm and fix it.

Possible cause:
The @ symbol is hardcoded in "cmMakefileTargetGenerator::AddIncludeFlags" function in file ../Source/cmMakefileTargetGenerator.cxx

  if (useResponseFile) {
    std::string name = "includes_";
    name += lang;
    name += ".rsp";
    std::string arg = "@" +
      this->CreateResponseFile(name.c_str(), includeFlags,
                               this->FlagFileDepends[lang]);
    this->LocalGenerator->AppendFlags(flags, arg);
  }

However, the implementation should be like in "cmMakefileTargetGenerator::CreateObjectLists" function.

    // Lookup the response file reference flag.
    std::string responseFlagVar = "CMAKE_";
    responseFlagVar +=
      this->GeneratorTarget->GetLinkerLanguage(this->ConfigName);
    responseFlagVar += "_RESPONSE_FILE_LINK_FLAG";
    const char* responseFlag = this->Makefile->GetDefinition(responseFlagVar);
    if (!responseFlag) {
      responseFlag = "@";
    }

Thanks,
Lenin

-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Freitag, 19. Januar 2018 15:01
To: Jayakumar, Lenindarbi <Lenindarbi.Jayakumar at magna.com<mailto:Lenindarbi.Jayakumar at magna.com>>; cmake-developers at cmake.org<mailto:cmake-developers at cmake.org>
Subject: Re: [cmake-developers] CMAKE :: mingw make files with response file for includes

On 01/17/2018 03:52 AM, Jayakumar, Lenindarbi wrote:
> Response file link flag "CMAKE_C_RESPONSE_FILE_LINK_FLAG" is not
> customizable for include paths.
> The @ symbol is hardcoded in "cmMakefileTargetGenerator::AddIncludeFlags"

In case the compiler and link driver want different response file flags, one could add a separate "CMAKE_<LANG>_RESPONSE_FILE_COMPILE_FLAG" variable to use for include flags.  See

  https://gitlab.kitware.com/cmake/cmake/blob/master/CONTRIBUTING.rst

for contribution instructions if you'd like to work on it.

Thanks,
-Brad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20180411/24cb1cf2/attachment.html>
-------------- next part --------------
An embedded message was scrubbed...
From: "Jayakumar, Lenindarbi" <Lenindarbi.Jayakumar at magna.com>
Subject: CMAKE :: mingw make files with response file for includes
Date: Wed, 17 Jan 2018 08:52:54 +0000
Size: 15808
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20180411/24cb1cf2/attachment.mht>


More information about the cmake-developers mailing list