argtable / argtable3

A single-file, ANSI C, command-line parsing library that parses GNU-style command-line options.
http://www.argtable.org
Other
372 stars 65 forks source link

Why _static for static libaries #101

Open heitbaum opened 2 months ago

heitbaum commented 2 months ago

Hi @tomghuang, why use _static in the following as the .an already signifies that the library is static. For compiling we would like to just use -largtable3 and depending on if shared or static is available, the linkage will just work. Could this be dropped?

https://github.com/argtable/argtable3/blob/76fd1576e296bd9f93309b2a6e16a3268ad9b8c8/src/CMakeLists.txt#L91

tomghuang commented 2 months ago

@heitbaum : Have you tried and confirmed that after removing the _static suffix is OK for you?

heitbaum commented 2 months ago

Updating the line to OUTPUT_NAME "argtable3" fixes the issue. No need to do anything special for shared versus static.

usr/lib$ find .
./libargtable3.so.0.0.0
./cmake
./cmake/argtable3
./cmake/argtable3/Argtable3Config.cmake
./cmake/argtable3/Argtable3ConfigVersion.cmake
./cmake/argtable3/Argtable3Config-release.cmake
./libargtable3.so.0
./libargtable3.so
./pkgconfig
./pkgconfig/argtable3.pc

and

usr/lib$ find .
./cmake
./cmake/argtable3
./cmake/argtable3/Argtable3Config.cmake
./cmake/argtable3/Argtable3ConfigVersion.cmake
./cmake/argtable3/Argtable3Config-release.cmake
./pkgconfig
./pkgconfig/argtable3.pc
./libargtable3.a
tomghuang commented 2 months ago

@heitbaum : Thanks for your feedback. I'll remove the _static suffix.