mirror of
https://github.com/minetest/minetest.git
synced 2025-09-18 03:15:20 +02:00
Prevent mixing in-tree and out-of-tree builds
This is an easy pitfall to encounter when running an Android build.
This commit is contained in:
@@ -375,6 +375,9 @@ endif()
|
|||||||
|
|
||||||
check_include_files(endian.h HAVE_ENDIAN_H)
|
check_include_files(endian.h HAVE_ENDIAN_H)
|
||||||
|
|
||||||
|
if((NOT PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) AND EXISTS "${PROJECT_SOURCE_DIR}/cmake_config.h")
|
||||||
|
message(FATAL_ERROR "You are doing an out-of-tree build, but build artifacts are left in-tree. This will break the build!")
|
||||||
|
endif()
|
||||||
configure_file(
|
configure_file(
|
||||||
"${PROJECT_SOURCE_DIR}/cmake_config.h.in"
|
"${PROJECT_SOURCE_DIR}/cmake_config.h.in"
|
||||||
"${PROJECT_BINARY_DIR}/cmake_config.h"
|
"${PROJECT_BINARY_DIR}/cmake_config.h"
|
||||||
|
Reference in New Issue
Block a user