From 65dae0d0a10c4f02d597e385a67e11927579d94e Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sat, 11 Feb 2017 14:18:38 -0800 Subject: [PATCH] support Ninja cmake generator on msys2 Add a hack to the root CMakeLists.txt to SET(MSYS ON) for the Ninja generator when running under msys2, otherwise it cannot find libs. The quoting fixes from #70 allow all of this to work. --- CMakeLists.txt | 5 +++++ README.md | 2 ++ 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bb5b770b..d15494bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,11 @@ ELSE() ADD_DEFINITIONS(-DNDEBUG) ENDIF() +# hack for ninja in msys2 +IF(WIN32 AND CMAKE_GENERATOR STREQUAL Ninja AND (NOT $ENV{MSYSTEM} STREQUAL "")) + SET(MSYS ON) +ENDIF() + # Add support for Homebrew, MacPorts and Fink on OS X IF(APPLE) INCLUDE(MacPackageManagers) diff --git a/README.md b/README.md index 3b66489b..90c84d35 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ make -j10 `./installdeps` is supported on MSys2, Linux (Debian/Ubuntu, Fedora or Arch Linux) and Mac OS X (homebrew, macports or fink.) +The Ninja cmake generator is also now supported, including on msys2. + If your OS is not supported, you will need the following: - c++ compiler and binutils