Skip to content

Allow Windows builds using MSYS2 Environment #41

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 4 commits into from
Oct 17, 2016

Conversation

cr1901
Copy link
Collaborator

@cr1901 cr1901 commented Sep 11, 2016

Meant to file this weeks ago, but the following commits permit Windows builds using the MSYS2 environment.

The doc target doesn't work; there's a bug in MikTeX that prevents it from finding one of the 5000 packages required even though it exists on my path. My suggestion for now is to just touch an empty file to skip doc building.

I am making a pull request instead of committing directly to get feedback. Since you intend to replace the build system, this is a stopgap for now.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
vbgl Vincent Laporte
//Conflicts with ERROR enum defined in log.h.
#if defined(_WIN32) && defined(ERROR)
#undef ERROR
#endif
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is windows.h included in this header though?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't remember. Checking now; I found this out by chance when I ran the compile command with -E to look at preprocessed output.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

libusb is including it, according to the output of the following command: /C/msys64/mingw32/bin/g++.exe -H -D__USE_MINGW_ANSI_STDIO=1 -Wall -Wextra -Wcast-align -Winit-self -Wmissing-declarations -Wswitch -Wwrite-strings -std=c++11 -shared-libgcc -ggdb -c /C/msys64/home/William/src/openfpga/src/gp4prog/main.cpp 2> main.e

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, so let's kick libusb out of gp4prog.h. Just pre-declare it as struct libusb_device_handle;

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That fixes part of the problem. However, usb.cpp will need libusb, and also depends on log.h, so the ERROR identifier still needs to be undefined.

Limits the scope of the "damage", but doesn't eliminate it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, that's still good, because it means that nothing else that includes gp4prog.h will have the same problem.

@whitequark whitequark merged commit 8ede4a7 into azonenberg:master Oct 17, 2016
@cr1901 cr1901 deleted the msys branch October 23, 2016 00:20
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.

None yet

2 participants