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.
This commit is contained in:
baldurk
2016-09-27 13:45:32 +02:00
parent abed75a9aa
commit c968ab673c
+4 -4
View File
@@ -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")