[cmake-developers] FW: FW: Initial Attempt at Green Hill MULTI IDE Generator Support

Geoffrey Viola Geoffrey.Viola at asirobots.com
Mon Mar 2 11:30:59 EST 2015


> I made the change just now. I'll rerun the tests.
>
> I haven't seen "glv.asi" submit in a few days.  Is it running nightly?

It should be. The past weekend was an exception. I forgot the power cord for that computer. I hoped for less CMake development on the weekend.

When I reran the experimental test with my patch, I noticed that my tests weren't passing. I'm still working on it.

>I've looked more through the patch sent here:
>
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/11260/focus=12469
>
>> +void
>> +cmGlobalGhsMultiGenerator::EnableLanguage(std::vector<std::string> const &l,
>> +                                          cmMakefile *mf, bool
>> +optional) {
>> +  mf->AddDefinition("CMAKE_C_COMPILER", "${CMAKE_GENERATOR_CC}");
>> +  mf->AddDefinition("CMAKE_C_COMPILER_ID_RUN", "TRUE");
>> +  mf->AddDefinition("CMAKE_C_COMPILER_ID", "GhsMultiArmC");
>> +  mf->AddDefinition("CMAKE_C_COMPILER_FORCED", "TRUE");
>> +
>> +  mf->AddDefinition("CMAKE_CXX_COMPILER", "${CMAKE_GENERATOR_CXX}");
>> + mf->AddDefinition("CMAKE_CXX_COMPILER_ID_RUN", "TRUE");
>> + mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GhsMultiArmCXX");
>> + mf->AddDefinition("CMAKE_CXX_COMPILER_FORCED", "TRUE");
>> +
>> +  mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake
>> +files
>> +  this->cmGlobalGenerator::EnableLanguage(l, mf, optional); }
>
>This looks based on my suggestion from an earlier review:
>
> http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/11260/focus=11538
>
>so I think this is the right place for such code.  However, the hunk above needs some work.  First, the changes to Modules/CMakeCompilerIdDetection.cmake indicate that the compiler id is "GHS", so the CMAKE_<LANG>_COMPILER_ID should be set to that in the code above.
>
>The compiler path values are set to literal "${...}"
>strings but that will not be interpreted.  Alternatives:
>
>* Set CMAKE_GENERATOR_CC and CMAKE_GENERATOR_CXX to ccarm
>  and cxarm in the above code and let the normal compiler
>  search logic in CMakeDetermine*Compiler.cmake actually
>  find the compiler instead of using find_program in
>  CMakeGreenHillsFindMake.
>
>* Have EnableLanguage compute the exact path to the compiler
>  tools itself, possibly using GHS_COMP_ROOT.
>
>Most of the code in CMakeGreenHillsFindMake actually belongs in "Modules/Platform/GHS-MULTI.cmake".  The EnableLanguage method should set CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR.
>It could even have C++-implemented logic to find GHS_COMP_ROOT (are there registry values for it?).  Then CMakeGreenHillsFindMake should have the minimum code needed to find the make tool given GHS_COMP_ROOT.  Then I think everything else can go in
>
> Modules/Platform/GHS-MULTI-Initialize.cmake
> Modules/Platform/GHS-MULTI.cmake
>
>The -Initialize module will be loaded pretty early and is the place to find platform-specific SDKs and such.  This is likely the place for all those GHS_* cache options.

Good feedback. I should have time to dig into it sometime this week.

Geoffrey Viola
SOFTWARE ENGINEER
asirobots.com



-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Monday, March 02, 2015 7:48 AM
To: Geoffrey Viola
Cc: cmake-developers at cmake.org
Subject: Re: FW: FW: [cmake-developers] Initial Attempt at Green Hill MULTI IDE Generator Support

On 02/27/2015 11:29 AM, Geoffrey Viola wrote:
>> set(ENV{PATH} "c:\\Windows\\system32;c:\\Windows")
>> We should test with at least the basic Windows PATH set.
> I made the change just now. I'll rerun the tests.

I haven't seen "glv.asi" submit in a few days.  Is it running nightly?

> Let me know if there is anything more I can do.

I've looked more through the patch sent here:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/11260/focus=12469

> +void
> +cmGlobalGhsMultiGenerator::EnableLanguage(std::vector<std::string> const &l,
> +                                          cmMakefile *mf, bool
> +optional) {
> +  mf->AddDefinition("CMAKE_C_COMPILER", "${CMAKE_GENERATOR_CC}");
> +  mf->AddDefinition("CMAKE_C_COMPILER_ID_RUN", "TRUE");
> +  mf->AddDefinition("CMAKE_C_COMPILER_ID", "GhsMultiArmC");
> +  mf->AddDefinition("CMAKE_C_COMPILER_FORCED", "TRUE");
> +
> +  mf->AddDefinition("CMAKE_CXX_COMPILER", "${CMAKE_GENERATOR_CXX}");
> + mf->AddDefinition("CMAKE_CXX_COMPILER_ID_RUN", "TRUE");
> + mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GhsMultiArmCXX");
> + mf->AddDefinition("CMAKE_CXX_COMPILER_FORCED", "TRUE");
> +
> +  mf->AddDefinition("GHSMULTI", "1"); // identifier for user CMake
> +files
> +  this->cmGlobalGenerator::EnableLanguage(l, mf, optional); }

This looks based on my suggestion from an earlier review:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/11260/focus=11538

so I think this is the right place for such code.  However, the hunk above needs some work.  First, the changes to Modules/CMakeCompilerIdDetection.cmake indicate that the compiler id is "GHS", so the CMAKE_<LANG>_COMPILER_ID should be set to that in the code above.

The compiler path values are set to literal "${...}"
strings but that will not be interpreted.  Alternatives:

* Set CMAKE_GENERATOR_CC and CMAKE_GENERATOR_CXX to ccarm
  and cxarm in the above code and let the normal compiler
  search logic in CMakeDetermine*Compiler.cmake actually
  find the compiler instead of using find_program in
  CMakeGreenHillsFindMake.

* Have EnableLanguage compute the exact path to the compiler
  tools itself, possibly using GHS_COMP_ROOT.

Most of the code in CMakeGreenHillsFindMake actually belongs in "Modules/Platform/GHS-MULTI.cmake".  The EnableLanguage method should set CMAKE_SYSTEM_NAME and CMAKE_SYSTEM_PROCESSOR.
It could even have C++-implemented logic to find GHS_COMP_ROOT (are there registry values for it?).  Then CMakeGreenHillsFindMake should have the minimum code needed to find the make tool given GHS_COMP_ROOT.  Then I think everything else can go in

 Modules/Platform/GHS-MULTI-Initialize.cmake
 Modules/Platform/GHS-MULTI.cmake

The -Initialize module will be loaded pretty early and is the place to find platform-specific SDKs and such.  This is likely the place for all those GHS_* cache options.

Thanks,
-Brad

This message contains confidential information and is intended only for the recipient. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately if you have received this e-mail by mistake and delete this e-mail from your system. Finally, the recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.


More information about the cmake-developers mailing list