Skip to content

Conversation

@dcandler
Copy link
Collaborator

@dcandler dcandler commented Dec 2, 2024

The additional_cmake_args variable is used to override the defaults and disable testing so that it can be controlled by the higher-level CMake project. But the variable is currently set only when the tests should be disabled. If the tests do not need to be disabled, the value is not updated and the version from the previous iteration of the loop will be used, potentially incorrectly disabling the tests.

To fix this, clear the value on every loop if not needed.

The additional_cmake_args variable is used to override the defaults
and disable testing so that it can be controlled by the higher-level
CMake project. But the variable is currently set only when the tests
should be disabled. If the tests do not need to be disabled, the
value is not updated and the version from the previous iteration of
the loop will be used, potentially incorrectly disabling the tests.

To fix this, clear the value on evry loop if not needed.
set(read_ENABLE_COMPILER_RT_TESTS "OFF")
set(read_ENABLE_LIBCXX_TESTS "OFF")
else()
set(additional_cmake_args "")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be better off above the if statement? That way if another conditional is added then it will automatically pick up a default "".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point - I've changed it so every loop starts with an empty list, and the args get appended which makes more sense.

Copy link
Contributor

@smithp35 smithp35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the update.

@dcandler dcandler merged commit cba1a32 into ARM-software:main Dec 2, 2024
1 check passed
@dcandler dcandler deleted the fix_loop_var branch December 2, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants