Skip to content

Fix pkg-config pthread flags for MSVC - #487

Merged
garyscavone merged 1 commit into
thestk:masterfrom
iibaranov-IG:fix/msvc-pkgconfig-pthread
Sep 12, 2026
Merged

garyscavone merged 1 commit into
thestk:masterfrom
iibaranov-IG:fix/msvc-pkgconfig-pthread

Conversation

@iibaranov-IG

Copy link
Copy Markdown
Contributor

Fixes #437.

The shared pkg-config template hardcodes -lpthread in Libs.private and -pthread in Cflags. CMake therefore emits those Unix flags even for an MSVC build, and an installed RtAudio package fails when an MSVC consumer resolves it through pkg-config.

Make the pthread compile and link flags configurable. CMake leaves them empty for MSVC and preserves the existing values for other toolchains. Autotools explicitly supplies the existing Unix values, so its generated package metadata is unchanged.

Validation:

  • CMake-generated Unix metadata still contains Libs.private: -lpthread and Cflags: -pthread ....
  • CMake-generated MSVC metadata contains neither -lpthread nor -pthread.
  • CMake release build succeeds on macOS/CoreAudio.
  • Autotools build succeeds on Debian/ALSA; make check passes (1/1).
  • Autotools-generated metadata retains the original pthread flags.
  • git diff --check passes.

@garyscavone
garyscavone merged commit c0a533d into thestk:master Sep 12, 2026
12 checks passed
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.

pkgconfig file hardcodes -lpthread

2 participants