-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Conversation
There was a problem hiding this 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.
contrib/buildsystems/CMakeLists.txt
Outdated
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") |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
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.
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. |
Excellent, thanks! Just two more things:
|
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]>
Finally fixed and passed the test! Thanks @dscho ! |
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
Fix CMakeLists for MinGW.
The previous command only suit for msvc
link.exe
.