Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,108
    • Issues 4,108
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 18
    • Merge requests 18
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #22169
Closed
Open
Issue created May 07, 2021 by Andrey Borisov@borisovandrey

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.

Edited May 07, 2021 by Brad King
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking