-
Notifications
You must be signed in to change notification settings - Fork 626
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
[Build][CMake][Windows] Issue to build on Windows when cygwin (awk ) is present in the PATH #571
Comments
Awk works just fine and is preferred. The scripts ( |
Thanks for looking. But on windows, the fact that awk are in the PATH (a border effect because cygwin are in the PATH) don't mean we want to use it (especially on Windows ). AWK is really mandatory to build libpng on windows ? |
The primary use of awk is to handle the configuration, however there is a "pre-built" configuration which corresponds to what is found in the system-installed libpng on most, maybe all, modern operating systems. Most of the time that is the only use of awk but symbol prefixing does require it. IRC the only other use, for building DLL symbol tables, got removed. Both configure and cmake check that awk works, so if one is found on the %path% it won't get used if it is broken. In any case in both build systems and all the Makefiles (IRC) "awk" is used via a #define of AWK, so:
Those builds should all use the program "path-to-awk" regardless of spurious stuff in %path%. (I just verified this for cmake and configure). cmake also have a way of forcing the prebuilt header to be used:
Of course that removes the ability to configure
But there is no way you use all the APIs (simplified, progressive, sequential, by-row, whole image...) So to just use the simplified API:
Ignore the error about STDERR if you see it; it's a recently introduced bug in pngtest.c, it doesn't affect the build (and pngtest.c doesn't work with the simplified API!) Doing this halves the size of the DLL while retaining all the read and write functionality that most programs require! If you use the sequential reader just to read the size reduction is even more spectacular:
Yep, that's all you need to do decode a PNG row-by-row in a way that is completely conformant to the specification. On Windows you probably want eliminate the stdio support too. Bear in mind that searching for awk on the path is a convenience for people who don't have a standard setup, if the path is set up in a way such that the wrong programs are found that's something that needs to be fixed. |
@SAP-BI please close this. |
Hello,
The CMake build on our build system is not working on Windows.
To work around this issue, I modified the following line:
libpng/CMakeLists.txt
Line 355 in e4a31f0
to :
Our build system has the Cygwin bin folder in the PATH for various reasons, so both awk and gawk are present.
If AWK is found in the PATH, it is used due to the line:
GitHub Link to CMakeLists.txt
Best regards,
Ghis
The text was updated successfully, but these errors were encountered: