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

Geoffrey Viola Geoffrey.Viola at asirobots.com
Mon Mar 16 02:03:45 EDT 2015


> In Modules/Platform/GHS-MULTI-Initialize.cmake:
>
>> +#Setup consistent compiler executables
>> +find_program(CMAKE_GENERATOR_CC ccarm PATHS ${GHS_COMP_ROOT})
>> +find_program(CMAKE_GENERATOR_CXX cxarm PATHS ${GHS_COMP_ROOT})

Removed

>> +string(REGEX MATCH "(comp_)([0-9]+)" CMAKE_SYSTEM_VERSION
>> +"${CMAKE_MAKE_PROGRAM}") string(REPLACE "comp_" ""
>> +CMAKE_SYSTEM_VERSION "${CMAKE_SYSTEM_VERSION}")
>
>EnableLanguage should be able to set CMAKE_SYSTEM_VERSION too now that it has code to find the comp root.

Done

>> +mark_as_advanced(CMAKE_MAKE_PROGRAM)
>
>This should not be needed.

Removed

>> +include(Platform/WindowsPaths)
>
>This should move to Modules/Platform/GHS-MULTI.cmake

Moved

>In EnableLanguage:
>
>> +  mf->AddDefinition("CMAKE_MAKE_PROGRAM",
>> +                    std::string(ghsCompRootStart +
>> + "gbuild.exe").c_str());
>
>The VS and Xcode generators no longer put this in the cache.
>Take a look at how the Xcode generator now does this with
>
> cmGlobalXCodeGenerator::FindMakeProgram
> cmGlobalXCodeGenerator::GetXcodeBuildCommand
> cmGlobalXCodeGenerator::FindXcodeBuildCommand
>
>and its call to SelectMakeProgram in GenerateBuildCommand:
>
>  this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand())
>
>Together this all allows the generator to compute the proper build tool without exposing any settings to the user.

Moved

>> +  mf->AddDefinition("CMAKE_C_COMPILER_ID", "GhsMultiArmC");
>[snip]
>> +  mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GhsMultiArmCXX");
>
>Instead of "GhsMultiArm*" these should be just "GHS", to be consistent with "Modules/Compiler/GHS-DetermineCompiler.cmake".

Renamed

>Please also look at modifying the Help/ directory to document the new generator.  You'll need at least to create/update:
>
> Help/manual/cmake-generators.7.rst
> Help/generator/Green Hills MULTI.rst
> Help/variable/CMAKE_MAKE_PROGRAM.rst
>
>where the change to the last one depends on the above updates.

Added some documentation.

I reran the experimental tests: https://open.cdash.org/viewTest.php?onlyfailed&buildid=3731770. I'm not quite sure why my FindModulesExecuteAll test fails. Seems like boost installation issue, but it isn't an issue in my nighlty test: https://open.cdash.org/testDetails.php?test=319857216&build=3731770.

Geoffrey Viola
SOFTWARE ENGINEER
asirobots.com



-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Thursday, March 12, 2015 2:18 PM
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 03/11/2015 01:39 PM, Geoffrey Viola wrote:
> Attached is a patch with the recommended changes

Thanks!  The basic toolchain initialization is pretty close.
Here are more comments.

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

> +#Setup consistent compiler executables
> +find_program(CMAKE_GENERATOR_CC ccarm PATHS ${GHS_COMP_ROOT})
> +find_program(CMAKE_GENERATOR_CXX cxarm PATHS ${GHS_COMP_ROOT})

This should not be needed at all.  The CMAKE_GENERATOR_* variables are just hints to the compiler detection logic.  Since this generator hard-codes the compiler setting in C++ the logic that uses these variables is never executed anyway.

> +string(REGEX MATCH "(comp_)([0-9]+)" CMAKE_SYSTEM_VERSION
> +"${CMAKE_MAKE_PROGRAM}") string(REPLACE "comp_" ""
> +CMAKE_SYSTEM_VERSION "${CMAKE_SYSTEM_VERSION}")

EnableLanguage should be able to set CMAKE_SYSTEM_VERSION too now that it has code to find the comp root.

> +mark_as_advanced(CMAKE_MAKE_PROGRAM)

This should not be needed.

> +include(Platform/WindowsPaths)

This should move to Modules/Platform/GHS-MULTI.cmake

In EnableLanguage:

> +  mf->AddDefinition("CMAKE_MAKE_PROGRAM",
> +                    std::string(ghsCompRootStart +
> + "gbuild.exe").c_str());

The VS and Xcode generators no longer put this in the cache.
Take a look at how the Xcode generator now does this with

 cmGlobalXCodeGenerator::FindMakeProgram
 cmGlobalXCodeGenerator::GetXcodeBuildCommand
 cmGlobalXCodeGenerator::FindXcodeBuildCommand

and its call to SelectMakeProgram in GenerateBuildCommand:

  this->SelectMakeProgram(makeProgram, this->GetXcodeBuildCommand())

Together this all allows the generator to compute the proper build tool without exposing any settings to the user.

> +  mf->AddDefinition("CMAKE_C_COMPILER_ID", "GhsMultiArmC");
[snip]
> +  mf->AddDefinition("CMAKE_CXX_COMPILER_ID", "GhsMultiArmCXX");

Instead of "GhsMultiArm*" these should be just "GHS", to be consistent with "Modules/Compiler/GHS-DetermineCompiler.cmake".

-----------------------------------------------------------------

Please also look at modifying the Help/ directory to document the new generator.  You'll need at least to create/update:

 Help/manual/cmake-generators.7.rst
 Help/generator/Green Hills MULTI.rst
 Help/variable/CMAKE_MAKE_PROGRAM.rst

where the change to the last one depends on the above updates.

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-some-support-for-a-Green-Hills-MULTI.patch
Type: application/octet-stream
Size: 68330 bytes
Desc: 0001-Added-some-support-for-a-Green-Hills-MULTI.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150316/55f07e85/attachment-0001.obj>


More information about the cmake-developers mailing list