diff options
| author | Alexandru Croitor <[email protected]> | 2025-09-04 12:07:08 +0200 |
|---|---|---|
| committer | Alexandru Croitor <[email protected]> | 2025-09-17 16:54:17 +0200 |
| commit | 26287dd0ee358875c7e839b7a21b0e7eea2ac7db (patch) | |
| tree | 9504a1932abb4f4d5e814b81d04dd69023a93c82 /cmake | |
| parent | 2088a1fff3926f723c03b96ebb9961a80ccf1f28 (diff) | |
CMake: Fix handling of empty CMAKE_BUILD_TYPE during SBOM generation
If a project is configured with an empty CMAKE_BUILD_TYPE, the SBOM
logic would skip adding any of the target files to the SBOM, because
it tried to iterate on the list of available configs.
Make sure to specify a custom "<EMPTY_CONFIG>" config in that case,
so that the loop doesn't become a no-op.
Pick-to: 6.8 6.9 6.10
Task-number: QTBUG-134894
Change-Id: I789a2d4d00375722d5b7257fd02ecf5ab4f0129e
Reviewed-by: Joerg Bornemann <[email protected]>
Diffstat (limited to 'cmake')
| -rw-r--r-- | cmake/QtPublicSbomFileHelpers.cmake | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cmake/QtPublicSbomFileHelpers.cmake b/cmake/QtPublicSbomFileHelpers.cmake index 52bf76148f6..2c3c9d7ff8f 100644 --- a/cmake/QtPublicSbomFileHelpers.cmake +++ b/cmake/QtPublicSbomFileHelpers.cmake @@ -604,8 +604,10 @@ function(_qt_internal_sbom_handle_multi_config_custom_file target) get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG) if(is_multi_config) set(configs ${CMAKE_CONFIGURATION_TYPES}) - else() + elseif(CMAKE_BUILD_TYPE) set(configs "${CMAKE_BUILD_TYPE}") + else() + set(configs "<EMPTY_CONFIG>") endif() foreach(config IN LISTS configs) @@ -1005,8 +1007,10 @@ function(_qt_internal_sbom_handle_multi_config_target_binary_file target) get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG) if(is_multi_config) set(configs ${CMAKE_CONFIGURATION_TYPES}) - else() + elseif(CMAKE_BUILD_TYPE) set(configs "${CMAKE_BUILD_TYPE}") + else() + set(configs "<EMPTY_CONFIG>") endif() foreach(config IN LISTS configs) |
