From 6929b524266d77b661d0e19a50e73ad0c9a05903 Mon Sep 17 00:00:00 2001 From: iDunk5400 Date: Thu, 6 Sep 2018 10:15:51 +0200 Subject: Windows: don't preset CMAKE_SYSTEM_NAME Let it be autodiscovered instead to avoid cmake thinking it's crosscompiling builds where host = target. This resolves a cmake configure error in MSYS2 caused by CMAKE_CROSSCOMPILING checks in #4294. --- cmake/32-bit-toolchain.cmake | 4 +++- cmake/64-bit-toolchain.cmake | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/32-bit-toolchain.cmake b/cmake/32-bit-toolchain.cmake index fe9aa483f..253523e66 100644 --- a/cmake/32-bit-toolchain.cmake +++ b/cmake/32-bit-toolchain.cmake @@ -26,7 +26,9 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set (CMAKE_SYSTEM_NAME Windows) +if (NOT CMAKE_HOST_WIN32) + set (CMAKE_SYSTEM_NAME Windows) +endif() set (GCC_PREFIX i686-w64-mingw32) set (CMAKE_C_COMPILER ${GCC_PREFIX}-gcc) diff --git a/cmake/64-bit-toolchain.cmake b/cmake/64-bit-toolchain.cmake index 20b568c71..b4b528347 100644 --- a/cmake/64-bit-toolchain.cmake +++ b/cmake/64-bit-toolchain.cmake @@ -26,7 +26,9 @@ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set (CMAKE_SYSTEM_NAME Windows) +if (NOT CMAKE_HOST_WIN32) + set (CMAKE_SYSTEM_NAME Windows) +endif() set (GCC_PREFIX x86_64-w64-mingw32) set (CMAKE_C_COMPILER ${GCC_PREFIX}-gcc) -- cgit v1.2.3