Improve handling if runtime_library_dirs is set with cygwin/mingw #150
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.
On Windows there is nothing like rpath, so when CygwinCCompiler()
tries to link it will assume unix and pass rpath flags to the linker,
which will fail.
In cygwin this is currently patched away:
https://cygwin.com/git-cygwin-packages/?p=git/cygwin-packages/python39.git;a=blob;f=3.1-enable-new-dtags.patch;h=716af3b14d3483e5a4
It is taking some macos fallback branch that is equal to library_dirs, which doesn't add much if
library_dirs is set, so in theory it should just return [] there.
This patch tries to bring it a bit closer to MSVCCompiler() which warns if
runtime_library_dirs is passed and raises if runtime_library_dir_option() is
called.
In the case of cygwin we only warn if runtime_library_dir_option() is called and return
nothing, so runtime_library_dirs is ignored. It's debatable if it should fail here,
but since cygwin is used to build unix software that might not be aware of this limitation
a warning seems more fitting.
In the mingw case we assume the user knows that they are targeting Windows and so we can be
more strict and error out like MSVCCompiler().
In both cases we warn if runtime_library_dirs is passed to the compiler, like with MSVC.