forked from Mirrorlandia_minetest/minetest
Mainly small build system fixes
This commit is contained in:
parent
eb476f1ce2
commit
359e575ba3
@ -10,25 +10,25 @@ project(minetest)
|
|||||||
set(VERSION_MAJOR 0)
|
set(VERSION_MAJOR 0)
|
||||||
set(VERSION_MINOR 0)
|
set(VERSION_MINOR 0)
|
||||||
set(VERSION_PATCH 1)
|
set(VERSION_PATCH 1)
|
||||||
|
set(VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
# Configuration options
|
||||||
include(${CMAKE_SOURCE_DIR}/cmake/Modules/misc.cmake)
|
|
||||||
|
|
||||||
# Default to Release
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
|
||||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Debug or Release" FORCE)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Configuration
|
|
||||||
|
|
||||||
set(RUN_IN_PLACE 0 CACHE BOOL "Run directly in source directory structure")
|
set(RUN_IN_PLACE 0 CACHE BOOL "Run directly in source directory structure")
|
||||||
|
|
||||||
set(BUILD_CLIENT 1 CACHE BOOL "Build client")
|
set(BUILD_CLIENT 1 CACHE BOOL "Build client")
|
||||||
set(BUILD_SERVER 1 CACHE BOOL "Build server")
|
set(BUILD_SERVER 1 CACHE BOOL "Build server")
|
||||||
|
|
||||||
# Get date and time
|
set(WARN_ALL 1 CACHE BOOL "Enable -Wall for Release build")
|
||||||
GETDATETIME(BUILD_DATE)
|
|
||||||
MESSAGE(STATUS "BUILD_DATE = ${BUILD_DATE}")
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
# Default to release
|
||||||
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Debug or Release" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Included stuff
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
|
||||||
|
include(${CMAKE_SOURCE_DIR}/cmake/Modules/misc.cmake)
|
||||||
|
|
||||||
# This is done here so that relative search paths are more reasnable
|
# This is done here so that relative search paths are more reasnable
|
||||||
find_package(Irrlicht)
|
find_package(Irrlicht)
|
||||||
@ -78,7 +78,7 @@ if(WIN32)
|
|||||||
install(FILES bin/minetestserver.exe DESTINATION bin)
|
install(FILES bin/minetestserver.exe DESTINATION bin)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-win32")
|
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-win32")
|
||||||
|
|
||||||
set(CPACK_GENERATOR ZIP)
|
set(CPACK_GENERATOR ZIP)
|
||||||
|
|
||||||
@ -87,7 +87,9 @@ if(WIN32)
|
|||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
# TODO
|
# TODO
|
||||||
# see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
|
# see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
|
||||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-osx")
|
# this too http://0xfe.blogspot.com/2006/03/how-os-x-executes-applications.html
|
||||||
|
#
|
||||||
|
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-osx")
|
||||||
set(CPACK_PACKAGE_ICON "")
|
set(CPACK_PACKAGE_ICON "")
|
||||||
set(CPACK_BUNDLE_NAME ${PROJECT_NAME})
|
set(CPACK_BUNDLE_NAME ${PROJECT_NAME})
|
||||||
set(CPACK_BUNDLE_ICON "")
|
set(CPACK_BUNDLE_ICON "")
|
||||||
@ -95,7 +97,7 @@ elseif(APPLE)
|
|||||||
set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest")
|
set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest")
|
||||||
set(CPACK_GENERATOR BUNDLE)
|
set(CPACK_GENERATOR BUNDLE)
|
||||||
else()
|
else()
|
||||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-linux")
|
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${VERSION_STRING}-linux")
|
||||||
set(CPACK_GENERATOR TGZ)
|
set(CPACK_GENERATOR TGZ)
|
||||||
set(CPACK_SOURCE_GENERATOR TGZ)
|
set(CPACK_SOURCE_GENERATOR TGZ)
|
||||||
endif()
|
endif()
|
||||||
|
@ -1,3 +1,9 @@
|
|||||||
|
#
|
||||||
|
# Random macros
|
||||||
|
#
|
||||||
|
|
||||||
|
# Not used ATM
|
||||||
|
|
||||||
MACRO (GETDATETIME RESULT)
|
MACRO (GETDATETIME RESULT)
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
EXECUTE_PROCESS(COMMAND "cmd" /C echo %date% %time% OUTPUT_VARIABLE ${RESULT})
|
EXECUTE_PROCESS(COMMAND "cmd" /C echo %date% %time% OUTPUT_VARIABLE ${RESULT})
|
||||||
@ -11,6 +17,5 @@ MACRO (GETDATETIME RESULT)
|
|||||||
ENDIF (WIN32)
|
ENDIF (WIN32)
|
||||||
|
|
||||||
string(REGEX REPLACE " " "_" ${RESULT} "${${RESULT}}")
|
string(REGEX REPLACE " " "_" ${RESULT} "${${RESULT}}")
|
||||||
|
|
||||||
ENDMACRO (GETDATETIME)
|
ENDMACRO (GETDATETIME)
|
||||||
|
|
||||||
|
@ -51,7 +51,8 @@ Compiling on GNU/Linux:
|
|||||||
* CMake
|
* CMake
|
||||||
* Irrlicht
|
* Irrlicht
|
||||||
* Zlib
|
* Zlib
|
||||||
- You can probably find these in your distro's package manager
|
- You can probably find these in your distro's package repository.
|
||||||
|
- Building has been tested to work flawlessly on many systems.
|
||||||
|
|
||||||
- Check possible options:
|
- Check possible options:
|
||||||
$ cd whatever/minetest
|
$ cd whatever/minetest
|
||||||
@ -81,7 +82,7 @@ Compiling on GNU/Linux:
|
|||||||
$ ./bin/minetest
|
$ ./bin/minetest
|
||||||
|
|
||||||
Compiling on Windows:
|
Compiling on Windows:
|
||||||
- You need CMake, Irrlicht, zlib and Visual Studio or MinGW
|
- You need CMake, Irrlicht, Zlib and Visual Studio or MinGW
|
||||||
- NOTE: Probably it will not work easily and you will need to fix some stuff.
|
- NOTE: Probably it will not work easily and you will need to fix some stuff.
|
||||||
- Steps:
|
- Steps:
|
||||||
- Start up the CMake GUI
|
- Start up the CMake GUI
|
||||||
|
@ -131,40 +131,43 @@ if(BUILD_SERVER)
|
|||||||
)
|
)
|
||||||
endif(BUILD_SERVER)
|
endif(BUILD_SERVER)
|
||||||
|
|
||||||
|
#
|
||||||
# Set some optimizations and tweaks
|
# Set some optimizations and tweaks
|
||||||
if( UNIX )
|
#
|
||||||
# Unix
|
|
||||||
|
|
||||||
# NOTE: -Wall gets applied automatically to debug builds
|
if(MSVC)
|
||||||
|
# Visual Studio
|
||||||
|
|
||||||
#set(UNIX_FLAGS "")
|
# EHa enables SEH exceptions (used for catching segfaults)
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "/EHa /MD /O2 /Ob2 /Oi /Ot /Oy /GL /FD /MT /GS- /arch:SSE /fp:fast")
|
||||||
if(BUILD_CLIENT)
|
set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1")
|
||||||
set_target_properties(minetest PROPERTIES COMPILE_FLAGS
|
|
||||||
"${UNIX_FLAGS}")
|
|
||||||
endif(BUILD_CLIENT)
|
|
||||||
|
|
||||||
if(BUILD_SERVER)
|
if(BUILD_SERVER)
|
||||||
set_target_properties(minetestserver PROPERTIES COMPILE_FLAGS
|
set_target_properties(minetestserver PROPERTIES
|
||||||
"${UNIX_FLAGS} -DSERVER")
|
COMPILE_FLAGS "/D SERVER")
|
||||||
endif(BUILD_SERVER)
|
endif(BUILD_SERVER)
|
||||||
|
|
||||||
else( UNIX )
|
else()
|
||||||
# Windows
|
# Probably GCC
|
||||||
|
|
||||||
if(BUILD_CLIENT)
|
if(WARN_ALL)
|
||||||
# EHa enables SEH exceptions (used for catching segfaults)
|
set(WARNING_FLAGS "-Wall")
|
||||||
set_target_properties(minetest PROPERTIES COMPILE_FLAGS
|
else()
|
||||||
"/O2 /Ob2 /Oi /Ot /Oy /GL /EHa")
|
set(WARNING_FLAGS "")
|
||||||
endif(BUILD_CLIENT)
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG ${WARNING_FLAGS} -O3 -ffast-math -Wall -fomit-frame-pointer -pipe -funroll-loops")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "-g -O1 -Wall")
|
||||||
|
|
||||||
if(BUILD_SERVER)
|
if(BUILD_SERVER)
|
||||||
# EHa enables SEH exceptions (used for catching segfaults)
|
set_target_properties(minetestserver PROPERTIES
|
||||||
set_target_properties(minetestserver PROPERTIES COMPILE_FLAGS
|
COMPILE_FLAGS "-DSERVER")
|
||||||
"/O2 /Ob2 /Oi /Ot /Oy /GL /EHa /D SERVER")
|
|
||||||
endif(BUILD_SERVER)
|
endif(BUILD_SERVER)
|
||||||
|
|
||||||
endif( UNIX )
|
endif()
|
||||||
|
|
||||||
|
#MESSAGE(STATUS "CMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}")
|
||||||
|
#MESSAGE(STATUS "CMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}")
|
||||||
|
|
||||||
#
|
#
|
||||||
# Installation
|
# Installation
|
||||||
|
@ -4,8 +4,13 @@
|
|||||||
#define CONFIG_H
|
#define CONFIG_H
|
||||||
|
|
||||||
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
|
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
|
||||||
#define VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
|
#define VERSION_STRING "@VERSION_STRING@"
|
||||||
#define BUILD_INFO "VER="VERSION_STRING" BUILD_DATE=@BUILD_DATE@ RUN_IN_PLACE=@RUN_IN_PLACE@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@"
|
#ifdef NDEBUG
|
||||||
|
#define BUILD_TYPE "Release"
|
||||||
|
#else
|
||||||
|
#define BUILD_TYPE "Debug"
|
||||||
|
#endif
|
||||||
|
#define BUILD_INFO "VER="VERSION_STRING" BUILD_DATE=@BUILD_DATE@ RUN_IN_PLACE=@RUN_IN_PLACE@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@ BUILD_TYPE="BUILD_TYPE
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "serialization.h"
|
#include "serialization.h"
|
||||||
#include "porting.h"
|
#include "porting.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env,
|
GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env,
|
||||||
gui::IGUIElement* parent, s32 id,
|
gui::IGUIElement* parent, s32 id,
|
||||||
@ -127,11 +128,11 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
|
|||||||
L"Minetest-c55\n"
|
L"Minetest-c55\n"
|
||||||
L"by Perttu Ahola\n"
|
L"by Perttu Ahola\n"
|
||||||
L"celeron55@gmail.com\n\n"
|
L"celeron55@gmail.com\n\n"
|
||||||
L"SER_FMT_VER_HIGHEST=%i\n"
|
SWPRINTF_CHARSTRING L"\n"
|
||||||
L"userdata path = \n"
|
L"userdata path = "
|
||||||
SWPRINTF_CHARSTRING
|
SWPRINTF_CHARSTRING
|
||||||
,
|
,
|
||||||
(int)SER_FMT_VER_HIGHEST,
|
BUILD_INFO,
|
||||||
porting::path_userdata.c_str()
|
porting::path_userdata.c_str()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user