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

Improve cross-compiling for Windows #505

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devinamatthews
Copy link
Member

Changes intended to fix whatever problems may exist for cross-compiling on Windows from Linux (incl. WSL) and macOS.

On macOS, we can cross-compile for Windows using mingw-w64. However, we
wind up in a case where both OS_NAME=Darwin and IS_WIN=yes. This commit
rearranges the checks in common.mk to check the latter first.
ifeq ($(CC_VENDOR),gcc)
SHLIB_EXT := dll.a
else
SHLIB_EXT := lib
endif
else ifeq ($(OS_NAME),Darwin)
Copy link
Contributor

@isuruf isuruf May 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only partially related, but we should do the as IS_WIN here. (Set IS_DARWIN by checking for __APPLE__ macro)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you're suggesting. IS_WIN is checked, I just moved that check before checking OS_NAME. I don't think that having OS_NAME=Darwin is necessarily bad in this circumstance, and I was able to successfully create a .dll on my machine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean when cross compiling for macOS from Linux.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. I didn't even know such a thing was possible. I'll save that for another issue/PR.

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.

2 participants