Green Hills MULTI issue with external project - primaryTarget=arm_.tgt
Hi, I try to make green hill project file using cmake.
My project contains fetching of google test (I know that google test doesn't support GHS compiler, but I expect to get at least project file itself).
Cmake command string is
cmake -G "Green Hills MULTI" -DGHS_PRIMARY_TARGET=arm_standalone.tgt ..
in build folder.
Google tests are included as:
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(GHS_PRIMARY_TARGET "arm_standalone.tgt" CACHE INTERNAL "Use GHS target" FORCE)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
But as a result the file build\_deps\googletest-subbuild\googletest-populate.top.gpj
has a string:
8: primaryTarget=arm_.tgt
I have found that this string is assembled in Source\cmGlobalGhsMultiGenerator.cxx (649):
fout << "primaryTarget=" << tgt << "\n"
"customization=" << root->GetBinaryDirectory()
<< "/CMakeFiles/custom_rule.bod\n"
"customization=" << root->GetBinaryDirectory()
<< "/CMakeFiles/custom_target.bod" << '\n';
and tgt is formed from GHS_PRIMARY_TARGET or from CMAKE_GENERATOR_PLATFORM and GHS_TARGET_PLATFORM
When I change in this expression tgt to "arm_standalone.tgt" cmake creates the GHS project well. It looks like in one of the run of this code the tgt is lost or some of the GHS constants is lost.