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
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers