aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt49
-rw-r--r--src/config.h.in9
-rw-r--r--src/guiPauseMenu.cpp7
3 files changed, 37 insertions, 28 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fea1f2644..c7c0a7025 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -131,40 +131,43 @@ if(BUILD_SERVER)
)
endif(BUILD_SERVER)
+#
# Set some optimizations and tweaks
-if( UNIX )
- # Unix
-
- # NOTE: -Wall gets applied automatically to debug builds
-
- #set(UNIX_FLAGS "")
+#
- if(BUILD_CLIENT)
- set_target_properties(minetest PROPERTIES COMPILE_FLAGS
- "${UNIX_FLAGS}")
- endif(BUILD_CLIENT)
+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_DEBUG "/MDd /Zi /Ob0 /Od /RTC1")
+
if(BUILD_SERVER)
- set_target_properties(minetestserver PROPERTIES COMPILE_FLAGS
- "${UNIX_FLAGS} -DSERVER")
+ set_target_properties(minetestserver PROPERTIES
+ COMPILE_FLAGS "/D SERVER")
endif(BUILD_SERVER)
-else( UNIX )
- # Windows
+else()
+ # Probably GCC
- if(BUILD_CLIENT)
- # EHa enables SEH exceptions (used for catching segfaults)
- set_target_properties(minetest PROPERTIES COMPILE_FLAGS
- "/O2 /Ob2 /Oi /Ot /Oy /GL /EHa")
- endif(BUILD_CLIENT)
+ if(WARN_ALL)
+ set(WARNING_FLAGS "-Wall")
+ else()
+ set(WARNING_FLAGS "")
+ 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)
- # EHa enables SEH exceptions (used for catching segfaults)
- set_target_properties(minetestserver PROPERTIES COMPILE_FLAGS
- "/O2 /Ob2 /Oi /Ot /Oy /GL /EHa /D SERVER")
+ set_target_properties(minetestserver PROPERTIES
+ COMPILE_FLAGS "-DSERVER")
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
diff --git a/src/config.h.in b/src/config.h.in
index 9f65386c2..42deb4bc5 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -4,8 +4,13 @@
#define CONFIG_H
#define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
-#define VERSION_STRING "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@"
-#define BUILD_INFO "VER="VERSION_STRING" BUILD_DATE=@BUILD_DATE@ RUN_IN_PLACE=@RUN_IN_PLACE@ INSTALL_PREFIX=@CMAKE_INSTALL_PREFIX@"
+#define VERSION_STRING "@VERSION_STRING@"
+#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
diff --git a/src/guiPauseMenu.cpp b/src/guiPauseMenu.cpp
index 46bb799e6..574cc774f 100644
--- a/src/guiPauseMenu.cpp
+++ b/src/guiPauseMenu.cpp
@@ -21,6 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "debug.h"
#include "serialization.h"
#include "porting.h"
+#include "config.h"
GUIPauseMenu::GUIPauseMenu(gui::IGUIEnvironment* env,
gui::IGUIElement* parent, s32 id,
@@ -127,11 +128,11 @@ void GUIPauseMenu::regenerateGui(v2u32 screensize)
L"Minetest-c55\n"
L"by Perttu Ahola\n"
L"celeron55@gmail.com\n\n"
- L"SER_FMT_VER_HIGHEST=%i\n"
- L"userdata path = \n"
+ SWPRINTF_CHARSTRING L"\n"
+ L"userdata path = "
SWPRINTF_CHARSTRING
,
- (int)SER_FMT_VER_HIGHEST,
+ BUILD_INFO,
porting::path_userdata.c_str()
);