Skip to content

Fix compilation with MinGW only #2053

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

Merged
merged 1 commit into from
Jan 5, 2020
Merged

Conversation

Baljak
Copy link
Contributor

@Baljak Baljak commented Jan 2, 2020

PR #1851 broke compilation with MinGW without MSYS. See #1851 (comment).

This fixes it while still retaining the intent of the original PR. Since both MSYS and MYS2 define a MSYSTEM environment variable, we just need to check if it is defined or not.

@kanonet
Copy link
Contributor

kanonet commented Jan 3, 2020

I tested this and can confirm, that this fix does not break compiling using msys2. So its all fine from my side.
BTW it can even get shortened to if(CMAKE_HOST_WIN32 AND NOT DEFINED ENV{MSYSTEM}) this would still work on my side. Thank you Baljak!

@Baljak Baljak force-pushed the mingw-compilation branch from c273000 to 401137c Compare January 3, 2020 08:07
@Baljak
Copy link
Contributor Author

Baljak commented Jan 3, 2020

Thanks for the review @kanonet. I simplified the check as you suggested.

@wjakob
Copy link
Member

wjakob commented Jan 5, 2020

Great, thanks everyone!

@wjakob wjakob merged commit 07e2259 into pybind:master Jan 5, 2020
@Baljak Baljak deleted the mingw-compilation branch January 31, 2020 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants