From 0695541bf59b305cc6661deb5d57a30e92cb9c6c Mon Sep 17 00:00:00 2001 From: Travis Wrightsman Date: Thu, 17 Apr 2025 12:35:31 +0200 Subject: [PATCH] Fix cross-building by ensuring output path is set --- src/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 88c0c5a45..d772c10ad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -591,9 +591,12 @@ if(USE_CURL) endif() -# When cross-compiling assume the user doesn't want to run the executable anyway, -# otherwise place it in /bin/ since Luanti can only run from there. -if(NOT CMAKE_CROSSCOMPILING) +# When cross-compiling place the executable in /bin so that multiple +# targets can be built from the same source folder. Otherwise, place it in +# /bin/ since Luanti can only run from there. +if(CMAKE_CROSSCOMPILING) + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin") +else() set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") endif()