1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00: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:
sfan5 2025-05-09 20:24:19 +02:00
parent 9b2ee1dd5d
commit 94dd3da2aa

View file

@ -375,6 +375,9 @@ endif()
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(
"${PROJECT_SOURCE_DIR}/cmake_config.h.in"
"${PROJECT_BINARY_DIR}/cmake_config.h"