cmake configuration for mingw-w64 #2103
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the netcdf package for mingw-w64, a patch is applied to the CMakeLists.txt file. To improve visibility of the changes involved, I am submitting the patch for inclusion in the netcdf source distribution.
Here is the original patch from MINGW-packages.
I have removed the definitions for variables
HAVE_WIN_TEMP
andHAVE_WIN_SSCANF
, which were used by other patches that are not required with the current netcdf master branch. I have also enabled the test formkstemp
, which is provided by the current mingw-w64 header files.I have added the definition of preprocessor macro
__USE_MINGW_ANSI_STDIO
, which enables support for ANSI standard format specifiers inprintf
and related functions, so that tests ofncdump
andncgen
do not fail with incorrectly formatted output.I have also added a compiler flag (where supported) so that
__FILE__
macros are converted to relative paths. Packages for mingw-w64 are required to be relocatable, and warnings are produced when building packages that refer to the absolute location of the build directory. The warnings are avoided by using relative paths in compiled objects. (Absolute paths in text files are replaced as part of the mingw-w64 package creation step).