diff options
author | Fred Baksik <fdk17@ftml.net> | 2021-11-15 18:15:10 (GMT) |
---|---|---|
committer | Fred Baksik <fdk17@ftml.net> | 2021-11-15 18:15:10 (GMT) |
commit | 831607889f6d197bba260fc604cd5df992d248b0 (patch) | |
tree | 47372a39aa91e53db765ce6b738d2d1190131d90 /Modules/Platform | |
parent | bff48c59080784217383a270cc5e6af4f0d7e510 (diff) | |
download | CMake-831607889f6d197bba260fc604cd5df992d248b0.zip CMake-831607889f6d197bba260fc604cd5df992d248b0.tar.gz CMake-831607889f6d197bba260fc604cd5df992d248b0.tar.bz2 |
GHS: Update selection of primaryTarget in MULTI project file
Changes to ``-A`` handling:
* Don't force CMAKE_GENERATOR_PLATFORM into cache when using default
value (breaks using CMake presets).
* Don't print message when using default value (breaks CMake tests).
Changes to ``GHS_PRIMARY_TARGET`` handling:
* Add as a cache variable so its known to GUI
* Don't always include``GHS_TARGET_PLATFORM``, it's only needed if
``GHS_PRIMARY_TARGET`` wasn't set by the user.
* Set ``GHS_PRIMARY_TARGET`` during platform selection instead of when
a language is enabled. By performing this sooner
``GHS_TARGET_PLATFORM`` is not always required to be set into cache.
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/GHS-MULTI-Determine.cmake | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Modules/Platform/GHS-MULTI-Determine.cmake b/Modules/Platform/GHS-MULTI-Determine.cmake index 349d906..3f094db 100644 --- a/Modules/Platform/GHS-MULTI-Determine.cmake +++ b/Modules/Platform/GHS-MULTI-Determine.cmake @@ -1,7 +1,21 @@ # Distributed under the OSI-approved BSD 3-Clause License. See accompanying # file Copyright.txt or https://cmake.org/licensing for details. -#Setup Green Hills MULTI specific compilation information +# Setup variables used for Green Hills MULTI generator +if(CMAKE_GENERATOR MATCHES "Green Hills MULTI") + + # Set the project primaryTarget value + # If not set then primaryTarget will be determined by the generator + set(GHS_PRIMARY_TARGET "IGNORE" CACHE STRING "GHS MULTI primaryTarget") + mark_as_advanced(GHS_PRIMARY_TARGET) + + if(NOT GHS_PRIMARY_TARGET) + # If project primaryTarget not set by user then set target platform name + # to be used by the generator when determining the primaryTarget. + set(GHS_TARGET_PLATFORM "integrity" CACHE STRING "GHS MULTI target platform") + mark_as_advanced(GHS_TARGET_PLATFORM) + endif() +endif() if(CMAKE_HOST_UNIX) set(GHS_OS_ROOT "/usr/ghs" CACHE PATH "GHS platform OS search root directory") @@ -30,7 +44,7 @@ if(NOT GHS_OS_DIR) endif () #filter based on platform name - if(GHS_TARGET_PLATFORM MATCHES "integrity") + if(GHS_PRIMARY_TARGET MATCHES "integrity" OR GHS_TARGET_PLATFORM MATCHES "integrity") list(FILTER GHS_CANDIDATE_OS_DIRS INCLUDE REGEX "int[0-9][0-9][0-9][0-9a-z]") else() #fall-back for standalone unset(GHS_CANDIDATE_OS_DIRS) @@ -50,6 +64,7 @@ endif() set(GHS_BSP_NAME "IGNORE" CACHE STRING "BSP name") +# Setup MULTI project variables set(GHS_CUSTOMIZATION "" CACHE FILEPATH "optional GHS customization") mark_as_advanced(GHS_CUSTOMIZATION) set(GHS_GPJ_MACROS "" CACHE STRING "optional GHS macros generated in the .gpjs for legacy reasons") |