-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version info in ogg.h #8
Comments
I don't think its a good idea to have it in the header file, mainly because the header and the actual lib can be out-of-sync with each other. Instead, I would suggest a function like:
|
Actually never liked this approach. In my opinion if you have not corresponding versions of library and header it's already something really wrong. That way you can't trust version in pc file also. |
Somebody else's thoughts on this? |
I don't see why the header is any more or less trustworthy than the pc file?
I tend to agree with erikd, but I don't think either make sense for libogg. It's quite mature, and unlike codecs is unlikely to have per-release bugs an embedded version string would help track down in the output. What benefit were you hoping to get by adding version information to the header? If you want make sure the library and header are in sync you need both. For example, libpng does this. In practice no one checks both and compares, so I think it's not worth adding the api surface. |
A little missunderstanding here. I'm not saying that pc file is not trustworthy. I'm saying that pc file cannot be used on Windows and OS X. So it would be great to have version info both in header and pc files.
I just like to see library versions while configuring projects like:
|
It looks like FindZLib just does a regexp on the .h to find the version. Source packages of ogg have a configure script, and devel versions have a configure.ac file. This script has a PACKAGE_VERSION line, as well as several OGG_LIB_* lines. Couldn't you parse that? |
@tdaede And now imagine someone configuring ogg-dependent project on Windows. In many cases they will use prebuilt binaries pacakges that contain lib and h files only. Or prebuilt framework on OS X. Or even installed devel package from apt-get on Debian. In all this cases you obviously can't parse configure script. Header file seems the only common denominator across all platforms for me. |
On Linux (and OS X when using homebrew), the .pc file will be installed and should always be the mechanism used. We don't distribute official packages for Windows, and until recently most users of libogg were building it themselves in their own projects. So these prebuilt binary packages don't exist yet. Presumably we can also define what goes in them. Putting it in a .h file would be okay, but it is slightly weird as it is intended for the build system, not programs using libogg. Does windows have a native version of .pc, maybe provided by OneGet/NuGet? We could also bundle a VERSION file in the binary packages or something. |
While homebrew is awesome for using on developer machines you can't actually link against libraries from homebrew in apps you plan to distribute. You simply can't ask users to install homebrew and run
And many of them still do. And most of them build ogg once and than copy header and library to some kind of "prebuilt dependencies" folder. |
Btw maybe we can simply add version to |
I don't think we're convinced the benefits here outweigh the drawbacks. Closing as wontfix. |
So, I asked on #cmake:
Does this seem like a good solution? If so, you can reopen this issue or make a new one about implementing this. |
Many other projects (zlib, png, SDL2, ...) embed version info in header file. I think ogg could also benefit from that. Yes, I'm aware of version info in pc files but that's not an option on Windows.
The text was updated successfully, but these errors were encountered: