Skip to content

Fix scope of PM_ACTUAL_LIB_NAME#101

Closed
rrrapha wants to merge 1 commit intoPortMidi:masterfrom
rrrapha:static-lib-name
Closed

Fix scope of PM_ACTUAL_LIB_NAME#101
rrrapha wants to merge 1 commit intoPortMidi:masterfrom
rrrapha:static-lib-name

Conversation

@rrrapha
Copy link
Copy Markdown
Contributor

@rrrapha rrrapha commented Oct 27, 2025

Setting an alternative name for the static library via PM_STATIC_LIB_NAME has been broken in commit e878378.

This change fixes it by setting PM_ACTUAL_LIB_NAME in the current scope AND the parent scope.

It can be tested like this:

cmake -DBUILD_SHARED_LIBS=OFF -DPM_STATIC_LIB_NAME=test .
make

This should print PortMidi Library name: test and produce libtest.a.

@rbdannenberg
Copy link
Copy Markdown
Contributor

Thanks! I had to get Claude to explain CMake scope rules to understand this. That seems like a real design flaw in CMake. Rather than pulling these changes, I added comments and fixes locally because without comments or a deeper understanding of CMake, the logic seems really strange. Maybe that's why it got broken to begin with.

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