Skip to content

Commit 7fbb49d

Browse files
committed
Update README for MinGW compile
A bad interaction between CMake, MinGW, and Googletest prevents MinGW from compiling Googletest with threads. google/googletest#606 So we must configure Googletest without threading support.
1 parent 8269175 commit 7fbb49d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,18 @@ cmake --build . --config {Release|Debug|MinSizeRel|RelWithDebInfo}
8989
ctest -C {Release|Debug|MinSizeRel|RelWithDebInfo}
9090
```
9191

92+
4c) Or build with MinGW on Linux for Windows:
93+
(Skip building threaded unit tests due to
94+
[Googletest bug 606](https://github.com/google/googletest/issues/606))
95+
96+
```sh
97+
cd $BUILD_DIR
98+
cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR \
99+
-DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/linux-mingw-toolchain.cmake \
100+
-Dgtest_disable_pthreads=ON
101+
ninja
102+
```
103+
92104
After a successful build, you should have a `glslc` executable somewhere under
93105
the `$BUILD_DIR/glslc/` directory, as well as a `libshaderc` library somewhere
94106
under the `$BUILD_DIR/libshaderc/` directory.
@@ -117,6 +129,10 @@ On Linux, the following tools should be installed:
117129
- [`genhtml`](http://linux.die.net/man/1/genhtml): for creating reports in html
118130
format from `lcov` output, provided by the `lcov` package on Ubuntu.
119131

132+
On Linux, if cross compiling to Windows:
133+
- [`mingw`](http://www.mingw.org): A GCC-based cross compiler targeting Windows
134+
so that generated executables use the Micrsoft C runtime libraries.
135+
120136
On Windows, the following tools should be installed and available on your path:
121137

122138
- Visual Studio 2013 Update 4 or later. Previous versions of Visual Studio

0 commit comments

Comments
 (0)