Skip to content

CMake: unix-like systems don't need a static library suffix - #933

Merged
bradh352 merged 1 commit into
c-ares:mainfrom
bradh352:staticlib-name
Dec 11, 2024
Merged

CMake: unix-like systems don't need a static library suffix#933
bradh352 merged 1 commit into
c-ares:mainfrom
bradh352:staticlib-name

Conversation

@bradh352

@bradh352 bradh352 commented Dec 11, 2024

Copy link
Copy Markdown
Member

On Windows, the output name should have a static suffix since otherwise we would have conflicting output names (libcares.lib) for the link library. However on Unix-like systems, we typically have something like libcares.so for shared libraries and libcares.a for static libraries, so these don't conflict. This behavior better emulates what happens with autotools builds.

This fixes issues with package config and trying to static link when you have c-ares built as both dynamic and static.

Discussion from #925

Signed-off-by: Brad House (@bradh352)

@bradh352
bradh352 merged commit 23c1c11 into c-ares:main Dec 11, 2024
bradh352 added a commit that referenced this pull request Dec 11, 2024
On Windows, the output name should have a static suffix since otherwise
we would have conflicting output names (libcares.lib) for the link
library. However on Unix-like systems, we typically have something like
libcares.so for shared libraries and libcares.a for static libraries, so
these don't conflict. This behavior better emulates what happens with
autotools builds.

This fixes issues with package config and trying to static link when you
have c-ares built as both dynamic and static.

Discussion from #925

Signed-off-by: Brad House (@bradh352)
@bradh352
bradh352 deleted the staticlib-name branch December 12, 2024 15:45
michael-dev pushed a commit to HamelinPorts/android_external_c-ares that referenced this pull request Apr 25, 2026
On Windows, the output name should have a static suffix since otherwise
we would have conflicting output names (libcares.lib) for the link
library. However on Unix-like systems, we typically have something like
libcares.so for shared libraries and libcares.a for static libraries, so
these don't conflict. This behavior better emulates what happens with
autotools builds.

This fixes issues with package config and trying to static link when you
have c-ares built as both dynamic and static.

Discussion from c-ares#925

Signed-off-by: Brad House (@bradh352)
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