Skip to content

Fix CMakeLists for MinGW. #3466

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
Oct 14, 2021
Merged

Fix CMakeLists for MinGW. #3466

merged 1 commit into from
Oct 14, 2021

Conversation

Berrysoft
Copy link

The previous command only suit for msvc link.exe.

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

In addition to combining the GNU/Clang conditions into a single one, I would like to ask to rebase this so that there is no merge commit to be merged.

target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
elseif(CMAKE_C_COMPILER_ID STREQUAL "Clang")
Copy link
Member

Choose a reason for hiding this comment

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

This could be combined with the "GNU" condition, right?

Copy link
Author

Choose a reason for hiding this comment

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

Yes.

Copy link
Author

@Berrysoft Berrysoft Oct 14, 2021

Choose a reason for hiding this comment

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

I'll simply merge the clang condition branch with gnu one. It needs further investigation.

@dscho
Copy link
Member

dscho commented Oct 14, 2021

Fix link options for gcc.

Also, please have a look at the existing commit messages. We don't have one-liners, and we take great care of making the commit messages very informative on their own. See 66ad532 for a great example to follow.

@dscho
Copy link
Member

dscho commented Oct 14, 2021

Excellent, thanks! Just two more things:

  • could you prefix the commit message with cmake: ? That's how the Git project makes it easy to see at a glance from looking at the commit history what the changes are all about

  • please use your real name in the Sign-off (and as author). The Git project requires this, see https://git-scm.com/docs/SubmittingPatches#sign-off:

    Also notice that a real name is used in the Signed-off-by trailer. Please don’t hide your real name.

    (Your contribution might be merged into Git for Windows, but ultimately we want it to end up in upstream Git.)

While MSVC needs to specify entry as `wWinMainCRTStartup`, MinGW
needs `-municode`. MinGW used to not support `wWinMain`, but recently it
finally adds support for that.

The support for clang is more complicated. This code was tested on MinGW
clang, provided by MSYS2 clang64, and it worked successfully. Further
investigation may be needed.

Signed-off-by: Yuyi Wang <[email protected]>
@Berrysoft
Copy link
Author

Finally fixed and passed the test! Thanks @dscho !

@dscho dscho merged commit c7d0a86 into git-for-windows:main Oct 14, 2021
@dscho dscho added this to the Next release milestone Oct 14, 2021
git-for-windows-ci pushed a commit that referenced this pull request Oct 14, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 14, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 14, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 14, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 14, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 14, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 14, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 15, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 15, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 15, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 15, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 15, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 15, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 15, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 18, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 19, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 19, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 19, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 22, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 24, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 24, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 24, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 25, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 26, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 28, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 28, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 28, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 28, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 28, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
git-for-windows-ci pushed a commit that referenced this pull request Oct 29, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Nov 1, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Nov 4, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Nov 4, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Nov 10, 2021
Fix CMakeLists for MinGW.
dscho added a commit that referenced this pull request Nov 16, 2021
Fix CMakeLists for MinGW.
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