Skip to content

Conversation

@mjp41
Copy link
Member

@mjp41 mjp41 commented Aug 5, 2025

The use of CACHE in the SNMALLOC_STATIC_LIBRARY_PREFIX was not correctly handled by cmake before 3.21.

The “set(CACHE)” command no longer removes a normal variable of the
same name, if any. See policy “CMP0126”.

Changing the minimum version means that containing projects can do:

set(SNMALLOC_STATIC_LIBRARY_PREFIX "my_prefix")

Without this, there were weird behaviours that the first compile used "sn_" and then subsequent compiles used "my_prefix".

Thanks to @achamayou for debugging this in CCF. microsoft/CCF#7161

The use of CACHE in the SNMALLOC_STATIC_LIBRARY_PREFIX was not correctly handled by cmake before 3.21.

> The “set(CACHE)” command no longer removes a normal variable of the
same name, if any. See policy “CMP0126”.

Changing the minimum version means that containing projects can do:

```CMake
set(SNMALLOC_STATIC_LIBRARY_PREFIX "my_prefix")
```

Without this, there were weird behaviours that the first compile used "sn_" and then subsequent compiles used "my_prefix".

Thanks to @achamayou for debugging this in CCF. microsoft/CCF#7161
@mjp41 mjp41 merged commit 3385660 into microsoft:main Aug 5, 2025
79 checks passed
@mjp41 mjp41 deleted the cmake_fun branch August 5, 2025 10:22
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.

1 participant