From c968ab673cb0f170956eab4c3f77f536fbd111fc Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 27 Sep 2016 13:45:32 +0200 Subject: [PATCH] Allow cross-compiles on windows via CMake * We only want to block windows-for-windows builds with CMake, not cross compiles for e.g. android from windows. * We move the fatal error later in the file after the cross-compilation has been initialised so we can check if we're really still WIN32. * This means the early-out on windows is a little late (after some autodetection has happened) but that's not the end of the world. --- CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2dac00d19..d2da34824 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 2.8.12) -if(WIN32) - message(FATAL_ERROR "CMake is not needed on Windows, just open and build renderdoc.sln") -endif() - # disallow in-source builds because we have a top-level wrapper Makefile if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) message(FATAL_ERROR "In-source builds not allowed") @@ -34,6 +30,10 @@ option(ENABLE_QRENDERDOC "Enable qrenderdoc" ON) option(ENABLE_XLIB "Enable xlib windowing support" ON) option(ENABLE_XCB "Enable xcb windowing support" ON) +if(WIN32) + message(FATAL_ERROR "CMake is not needed on Windows, just open and build renderdoc.sln") +endif() + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")