aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-01-18 15:05:29 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-01-18 15:05:29 +0200
commit3ef2629e847e1e7e239068bbf17bebd6d4ebfc95 (patch)
treed540c1068747ce73862237d80d6d04b15fa58eac /src
parent515a480d0e82fe77f1aae8115e81d720d7d1775b (diff)
downloadminetest-3ef2629e847e1e7e239068bbf17bebd6d4ebfc95.tar.gz
minetest-3ef2629e847e1e7e239068bbf17bebd6d4ebfc95.tar.bz2
minetest-3ef2629e847e1e7e239068bbf17bebd6d4ebfc95.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt9
-rw-r--r--src/cmake_config.h.in (renamed from src/config.h.in)4
-rw-r--r--src/config.h28
-rw-r--r--src/main.cpp2
4 files changed, 38 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c55b238e1..a9e3f2788 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -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)
diff --git a/src/config.h.in b/src/cmake_config.h.in
index 42deb4bc5..8635b4f28 100644
--- a/src/config.h.in
+++ b/src/cmake_config.h.in
@@ -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@"
diff --git a/src/config.h b/src/config.h
new file mode 100644
index 000000000..b24cf6a69
--- /dev/null
+++ b/src/config.h
@@ -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
+
diff --git a/src/main.cpp b/src/main.cpp
index 69c6dfd67..08a48d6dd 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -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