Skip to content
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

CMAKE_LEGACY_CYGWIN_WIN32 Is Unset #1322

Open
Alexhuszagh opened this issue Jul 21, 2017 · 3 comments
Open

CMAKE_LEGACY_CYGWIN_WIN32 Is Unset #1322

Alexhuszagh opened this issue Jul 21, 2017 · 3 comments

Comments

@Alexhuszagh
Copy link

DyND uses the WIN32 flag to remove the -fPIC -Wno-ignored-attributes flags during compilation, however, it fails to set the CMAKE_LEGACY_CYGWIN_WIN32 flag at the top of CMakeLists.txt. This flag sets WIN32 to be true on MSYS2/Cygwin compilers, which do not support either flag (and would typically ignore them, however, -Werror is enabled).

The solution is to add the following line to the toplevel CMakeLists.txt at the top of the file:

set(CMAKE_LEGACY_CYGWIN_WIN32 1)

Once again, I can submit a PR with the last 3 changes, if desired.

@insertinterestingnamehere
Copy link
Member

Thanks for the report.
Good find.
If we can, I'd rather just do if (WIN32 or CYGWIN), but it's not clear to me if that would handle the MSYS2 case you mentioned.
Any idea when exactly this is an issue within MSYS/MSYS2?
I haven't seen any issues using a CMake installed via the MSI file distributed by Kitware within MSYS2 myself. Maybe the issue shows up with binaries from elsewhere?

@Alexhuszagh
Copy link
Author

@insertinterestingnamehere I don't believe it's an issue on most MSYS2 installs, only ones using a Cygwin-like environment (but those may not set CYGWIN to true). I've been using the CI service Tea-CI, which is what MSYS2 uses to test their project. Under those conditions, the build fails since WIN32 is not set to be "truthy". Since this is a fairly rare case, but there are no side effects of set(CMAKE_LEGACY_CYGWIN_WIN32 1) for this project, I don't see any downside to defining it.

@insertinterestingnamehere
Copy link
Member

Okay, it looks like the warning is coming from the msys2 package's patch for CMake. See https://github.com/Alexpux/MSYS2-packages/blob/master/cmake/cmake-3.6.0-msys.patch#L791. I'm not a huge fan of legacy anything, but this looks like a good solution here.

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

No branches or pull requests

2 participants