From 4d0fef8ae87aa7b940d43485e7f6466eaa3d111e Mon Sep 17 00:00:00 2001 From: sfan5 Date: Sun, 11 Apr 2021 17:10:06 +0200 Subject: Buildbot changes to allow out-of-tree builds (#11180) * Do proper out-of-tree builds with buildbot * Don't write to bin/ for cross builds * This allows safely building multiple builds from the same source dir, e.g. with the buildbot. * Disable Gettext (by default) and Freetype (entirely) for server builds --- src/CMakeLists.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4bb6877d9..26441063f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,7 +55,7 @@ if(NOT USE_CURL) endif() -option(ENABLE_GETTEXT "Use GetText for internationalization" TRUE) +option(ENABLE_GETTEXT "Use GetText for internationalization" ${BUILD_CLIENT}) set(USE_GETTEXT FALSE) if(ENABLE_GETTEXT) @@ -120,13 +120,13 @@ endif() option(ENABLE_FREETYPE "Enable FreeType2 (TrueType fonts and basic unicode support)" TRUE) set(USE_FREETYPE FALSE) -if(ENABLE_FREETYPE) +if(BUILD_CLIENT AND ENABLE_FREETYPE) find_package(Freetype) if(FREETYPE_FOUND) message(STATUS "Freetype enabled.") set(USE_FREETYPE TRUE) endif() -endif(ENABLE_FREETYPE) +endif() option(ENABLE_CURSES "Enable ncurses console" TRUE) set(USE_CURSES FALSE) @@ -526,8 +526,11 @@ if(USE_CURL) endif() -set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") - +# When cross-compiling assume the user doesn't want to run the executable anyway, +# otherwise place it in /bin/ since Minetest can only run from there. +if(NOT CMAKE_CROSSCOMPILING) + set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin") +endif() if(BUILD_CLIENT) add_executable(${PROJECT_NAME} ${client_SRCS} ${extra_windows_SRCS}) -- cgit v1.2.3