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

Fix Mingw-w64 build #856

Merged
merged 1 commit into from
Sep 7, 2016
Merged

Conversation

KindDragon
Copy link
Contributor

@KindDragon KindDragon commented Aug 24, 2016

@BillyDonahue PR #721 break build with Mingw-w64, this PR should fix this

if ($env:generator -eq "MinGW Makefiles") {
$env:path = $env:path.replace("C:\Program Files\Git\usr\bin;", "")
if ($env:compiler -eq "gcc-5.3.0-posix") {
$cxx_path = "C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we being so specific here and specifying a path off of C:\ ?

Sorry I don't understand why so many files are being rewritten here.

Copy link
Contributor Author

@KindDragon KindDragon Aug 24, 2016

Choose a reason for hiding this comment

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

Why are we being so specific here?

For "MinGW Makefiles" CMake generator we remove Git from PATH environment variable and add mingw-w64 to PATH, so CMake able to build gtest.

... and specifying a path off of C:\

AppVeyor has preinstalled mingw-w64 i686-5.3.0 to this PATH https://www.appveyor.com/docs/installed-software/#mingw-msys-cygwin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for bugging you again what with PR #723 and #856? I'm sorry if I'm too intrusive 😊

@KindDragon KindDragon force-pushed the mingw-appveyor branch 2 times, most recently from dc19770 to b7c6562 Compare August 24, 2016 23:01
@KindDragon KindDragon changed the title Fix Mingw 5.3 and build on AppVeyour Fix Mingw-w64 and build on AppVeyour Aug 24, 2016
@KindDragon KindDragon changed the title Fix Mingw-w64 and build on AppVeyour Fix Mingw-w64 and build it on AppVeyor Aug 24, 2016
@KindDragon
Copy link
Contributor Author

KindDragon commented Aug 24, 2016

Now it should works with all cases

@dneto0
Copy link
Contributor

dneto0 commented Aug 25, 2016

This patch works for me with MinGW 4.8.2. I'm not exercising the AppVeyor part of of it though.

@@ -396,7 +396,7 @@
# include <io.h>
# endif
// In order to avoid having to include <windows.h>, use forward declaration
#if GTEST_OS_WINDOWS_MINGW
#if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
Copy link
Contributor

Choose a reason for hiding this comment

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

I can confirm that MinGW 4.8.2 g++ does not define this symbol.
The only symbols defined by that compiler with "MINGW" in its name are:

  • __MINGW32__ for the 32 bit compiler.
  • both __MINGW32__ and __MINGW64__ for the 64 bit compiler

@maxpiepenbrink
Copy link

maxpiepenbrink commented Aug 26, 2016

This PR fixes google-test building for me. Today's (commit ed9d1e1ff92ce199de5ca2667a667cd0a368482a) google-test master branch doesn't work for me currently. Environment:

Windows 10
Mingw-w64: x86_64-6.1.0-win32-seh-rt_v5-rev0
CMake 3.6
CLion 2016.2.1

I'm looking forward to this PR merge 👍

@dneto0
Copy link
Contributor

dneto0 commented Sep 2, 2016

Hi @BillyDonahue please take another look at this.
Currently I can't cross compile from Linux to Windows with the stock mingw-4.8.2 on Ubuntu trusty. This patch fixes the problem.

@rakhimov
Copy link

rakhimov commented Sep 3, 2016

Is this the old mingw/msys or the new msys2/mingw64 from https://github.com/Alexpux/MINGW-packages?

rakhimov added a commit to rakhimov/googletest that referenced this pull request Sep 3, 2016
@KindDragon KindDragon changed the title Fix Mingw-w64 and build it on AppVeyor Fix Mingw-w64 build Sep 4, 2016
@dneto0
Copy link
Contributor

dneto0 commented Sep 7, 2016

@rakhimov I'm using g++-mingw-w64 4.8.2-10ubuntu2+12 from Ubuntu trusty. As far as I know it's the stock mingw for Ubuntu trusty.

rakhimov added a commit to rakhimov/googletest that referenced this pull request Sep 7, 2016
@BillyDonahue BillyDonahue merged commit 48ee8e9 into google:master Sep 7, 2016
@KindDragon KindDragon deleted the mingw-appveyor branch September 8, 2016 00:12
KeeganMorrow added a commit to important-business/engine that referenced this pull request Dec 3, 2016
Update Google Test library to a version that contains a fix for
building under MinGW. This issue seems to have been resolved in
pull request google/googletest#856
KeeganMorrow added a commit to important-business/engine that referenced this pull request Dec 3, 2016
Update Google Test library to a version that contains a fix for
building under MinGW. This issue seems to have been resolved in
pull request google/googletest#856
zrax added a commit to zrax/string_theory that referenced this pull request Jan 11, 2017
AdeelH added a commit to AdeelH/opencv that referenced this pull request Feb 9, 2017
dneto0 added a commit to dneto0/shaderc that referenced this pull request Aug 9, 2023
When compiling with MinGW, we no longer need to use
-Dgtest_disable_pthreads=ON.

See google/googletest#856
and google/googletest#721
dneto0 added a commit to dneto0/shaderc that referenced this pull request Aug 9, 2023
When compiling with MinGW, we no longer need to use
-Dgtest_disable_pthreads=ON.

See google/googletest#856
and google/googletest#721
dneto0 added a commit to google/shaderc that referenced this pull request Aug 9, 2023
When compiling with MinGW, we no longer need to use
-Dgtest_disable_pthreads=ON.

See google/googletest#856
and google/googletest#721
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.

5 participants