summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2023-11-05 23:47:32 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-11-05 23:47:52 (GMT)
commit768690ee9a0a310f33201d9cabbc4f7ff9afabff (patch)
tree857d8f36188d9b0d41667a3ef07f03ccb94856d6
parent51d985da3e12f06ff9349970093d38d497ed3da0 (diff)
parent6a811044130624b32dcedb4c7a1142c3f7ad17f5 (diff)
downloadCMake-768690ee9a0a310f33201d9cabbc4f7ff9afabff.zip
CMake-768690ee9a0a310f33201d9cabbc4f7ff9afabff.tar.gz
CMake-768690ee9a0a310f33201d9cabbc4f7ff9afabff.tar.bz2
Merge topic 'FetchContent-GHS'
6a81104413 FetchContent: Pass GHS Variables to subbuild Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !8930
-rw-r--r--Modules/ExternalProject.cmake3
-rw-r--r--Modules/FetchContent.cmake14
2 files changed, 17 insertions, 0 deletions
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 67b805b..801a8de 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -3778,6 +3778,9 @@ function(_ep_extract_configure_command var name)
list(APPEND cmd "-G${CMAKE_EXTRA_GENERATOR} - ${CMAKE_GENERATOR}")
else()
list(APPEND cmd "-G${CMAKE_GENERATOR}")
+ # GreenHills needs to know about the compiler and toolset.
+ # Be sure to update the similar section in
+ # FetchContent.cmake:__FetchContent_directPopulate()
if("${CMAKE_GENERATOR}" MATCHES "Green Hills MULTI")
set(has_cmake_cache_default_args 1)
list(APPEND cmake_cache_default_args
diff --git a/Modules/FetchContent.cmake b/Modules/FetchContent.cmake
index f10684c..ad5a6f1 100644
--- a/Modules/FetchContent.cmake
+++ b/Modules/FetchContent.cmake
@@ -1596,6 +1596,20 @@ ExternalProject_Add_Step(${contentName}-populate copyfile
list(APPEND subCMakeOpts "-DCMAKE_MAKE_PROGRAM:FILEPATH=${CMAKE_MAKE_PROGRAM}")
endif()
+ # GreenHills needs to know about the compiler and toolset to run the
+ # subbuild commands. Be sure to update the similar section in
+ # ExternalProject.cmake:_ep_extract_configure_command()
+ if(CMAKE_GENERATOR MATCHES "Green Hills MULTI")
+ list(APPEND subCMakeOpts
+ "-DGHS_TARGET_PLATFORM:STRING=${GHS_TARGET_PLATFORM}"
+ "-DGHS_PRIMARY_TARGET:STRING=${GHS_PRIMARY_TARGET}"
+ "-DGHS_TOOLSET_ROOT:STRING=${GHS_TOOLSET_ROOT}"
+ "-DGHS_OS_ROOT:STRING=${GHS_OS_ROOT}"
+ "-DGHS_OS_DIR:STRING=${GHS_OS_DIR}"
+ "-DGHS_BSP_NAME:STRING=${GHS_BSP_NAME}"
+ )
+ endif()
+
# Override the sub-build's configuration types for multi-config generators.
# This ensures we are not affected by any custom setting from the project
# and can always request a known configuration further below.