made old build system to work too. the cmake one doesn't make working binaries for some computers.

--HG--
rename : src/config.h.in => src/cmake_config.h.in
This commit is contained in:
Perttu Ahola 2011-01-18 15:05:29 +02:00
parent 515a480d0e
commit 3ef2629e84
7 changed files with 46 additions and 13 deletions

@ -82,6 +82,9 @@ Compiling on GNU/Linux:
$ ./bin/minetest
Compiling on Windows:
- NOTE: Seems that the CMake build system produces executables that don't work
for many people. The old build system is still included, but it's not
documented in here.
- 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.
- Steps:

@ -15,10 +15,10 @@ cp bin/minetest.exe $PACKAGEPATH/bin/
cp bin/Irrlicht.dll $PACKAGEPATH/bin/
cp bin/zlibwapi.dll $PACKAGEPATH/bin/
#cp bin/test $PACKAGEPATH/bin/
cp bin/fasttest $PACKAGEPATH/bin/
cp bin/server $PACKAGEPATH/bin/
cp ../irrlicht/irrlicht-1.7.1/lib/Linux/libIrrlicht.a $PACKAGEPATH/bin/
cp ../jthread/jthread-1.2.1/src/.libs/libjthread-1.2.1.so $PACKAGEPATH/bin/
#cp bin/fasttest $PACKAGEPATH/bin/
#cp bin/server $PACKAGEPATH/bin/
#cp ../irrlicht/irrlicht-1.7.1/lib/Linux/libIrrlicht.a $PACKAGEPATH/bin/
#cp ../jthread/jthread-1.2.1/src/.libs/libjthread-1.2.1.so $PACKAGEPATH/bin/
cp -r data/fontlucida.png $PACKAGEPATH/data/
cp -r data/player.png $PACKAGEPATH/data/
@ -38,9 +38,6 @@ cp -r data/mud.png $PACKAGEPATH/data/
cp -r data/torch.png $PACKAGEPATH/data/
cp -r data/torch_on_floor.png $PACKAGEPATH/data/
cp -r data/torch_on_ceiling.png $PACKAGEPATH/data/
cp -r data/skybox1.png $PACKAGEPATH/data/
cp -r data/skybox2.png $PACKAGEPATH/data/
cp -r data/skybox3.png $PACKAGEPATH/data/
cp -r data/tree_top.png $PACKAGEPATH/data/
cp -r data/mud_with_grass.png $PACKAGEPATH/data/
cp -r data/coalstone.png $PACKAGEPATH/data/

@ -118,7 +118,7 @@
OmitFramePointers="true"
WholeProgramOptimization="true"
AdditionalIncludeDirectories=""C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include";"..\jthread\jthread-1.2.1\src";"..\irrlicht\irrlicht-1.7.1\include";"..\zlib\zlib-1.2.5""
PreprocessorDefinitions="WIN32;_HAS_ITERATOR_DEBUGGING=0;UNITTEST_DISABLE;_CRT_SECURE_NO_DEPRECATE;RUN_IN_PLACE"
PreprocessorDefinitions="WIN32;_HAS_ITERATOR_DEBUGGING=0;NDEBUG;_CRT_SECURE_NO_DEPRECATE;RUN_IN_PLACE"
ExceptionHandling="2"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="1"

@ -5,6 +5,9 @@ if(RUN_IN_PLACE)
add_definitions ( -DRUN_IN_PLACE )
endif(RUN_IN_PLACE)
# Use cmake_config.h
add_definitions ( -DUSE_CMAKE_CONFIG_H )
if(WIN32)
# Windows
# Surpress some warnings
@ -31,8 +34,8 @@ else()
endif()
configure_file(
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
"${PROJECT_SOURCE_DIR}/cmake_config.h.in"
"${PROJECT_BINARY_DIR}/cmake_config.h"
)
set(minetest_SRCS
@ -140,7 +143,7 @@ if(MSVC)
# Visual Studio
# 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")
set(CMAKE_CXX_FLAGS_RELEASE "/EHa /MD /O2 /Ob2 /Oi /Ot /Oy /GL /FD /MT /GS- /arch:SSE /fp:fast /D NDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1")
if(BUILD_SERVER)

@ -1,7 +1,7 @@
// Filled in by the build system
#ifndef CONFIG_H
#define CONFIG_H
#ifndef CMAKE_CONFIG_H
#define CMAKE_CONFIG_H
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
#define VERSION_STRING "@VERSION_STRING@"

28
src/config.h Normal file

@ -0,0 +1,28 @@
/*
If CMake is used, includes the cmake-generated cmake_config.h.
Otherwise use default values
*/
#ifndef CONFIG_H
#define CONFIG_H
#ifdef USE_CMAKE_CONFIG_H
#include "cmake_config.h"
#else
//#define INSTALL_PREFIX ""
#define VERSION_STRING "unknown"
#ifdef NDEBUG
#define BUILD_TYPE "Release"
#else
#define BUILD_TYPE "Debug"
#endif
#ifdef RUN_IN_PLACE
#define RUN_IN_PLACE_BOOLSTRING "1"
#else
#define RUN_IN_PLACE_BOOLSTRING "0"
#endif
#define BUILD_INFO "NON-CMAKE RUN_IN_PLACE="RUN_IN_PLACE_BOOLSTRING" BUILD_TYPE="BUILD_TYPE
#endif
#endif

@ -151,6 +151,8 @@ TODO: Untie client network operations from framerate
- Needs some input queues or something
- Not really necessary?
TODO: Make morning and evening shorter
Server:
TODO: When player dies, throw items on map