From 65ccd004efc7406463050d70a8f671d124e98930 Mon Sep 17 00:00:00 2001 From: David Neto Date: Wed, 16 Mar 2016 15:31:46 -0400 Subject: [PATCH] Update README for MinGW compile A bad interaction between CMake, MinGW, and Googletest prevents MinGW from compiling Googletest with threads. https://github.com/google/googletest/issues/606 So we must configure Googletest without threading support. --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index ca506d6ad..214da5956 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,18 @@ cmake --build . --config {Release|Debug|MinSizeRel|RelWithDebInfo} ctest -C {Release|Debug|MinSizeRel|RelWithDebInfo} ``` +4c) Or build with MinGW on Linux for Windows: +(Skip building threaded unit tests due to +[Googletest bug 606](https://github.com/google/googletest/issues/606)) + +```sh +cd $BUILD_DIR +cmake -GNinja -DCMAKE_BUILD_TYPE={Debug|Release|RelWithDebInfo} $SOURCE_DIR \ + -DCMAKE_TOOLCHAIN_FILE=$SOURCE_DIR/cmake/linux-mingw-toolchain.cmake \ + -Dgtest_disable_pthreads=ON +ninja +``` + After a successful build, you should have a `glslc` executable somewhere under the `$BUILD_DIR/glslc/` directory, as well as a `libshaderc` library somewhere under the `$BUILD_DIR/libshaderc/` directory. @@ -117,6 +129,10 @@ On Linux, the following tools should be installed: - [`genhtml`](http://linux.die.net/man/1/genhtml): for creating reports in html format from `lcov` output, provided by the `lcov` package on Ubuntu. +On Linux, if cross compiling to Windows: +- [`mingw`](http://www.mingw.org): A GCC-based cross compiler targeting Windows + so that generated executables use the Micrsoft C runtime libraries. + On Windows, the following tools should be installed and available on your path: - Visual Studio 2013 Update 4 or later. Previous versions of Visual Studio