From 39d46395d0634ac56e33b70670f55326240d81db Mon Sep 17 00:00:00 2001 From: Catherine Date: Wed, 22 Jan 2025 21:47:38 +0000 Subject: [PATCH] CMake: disallow in-tree builds. In-tree builds pollute the source directory and make version control more difficult to use effectively. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 31073c87..735494bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,7 @@ +if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) + message(FATAL_ERROR "In-tree builds are not supported. Instead, run:\ncmake . -B build && cmake --build build") +endif() + cmake_minimum_required(VERSION 3.25) project(nextpnr CXX)