Lots of small stuff
authorPerttu Ahola <celeron55@gmail.com>
Sat, 8 Jan 2011 17:35:14 +0000 (19:35 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 8 Jan 2011 17:35:14 +0000 (19:35 +0200)
CMakeLists.txt
src/CMakeLists.txt
src/config.h.in
src/debug.h
src/map.cpp

index 1ea10268a2fb0269e3649b383713f2f4540ffc63..a9d0f469b2fe4399108e87ccce0c5350cc2f020e 100644 (file)
@@ -7,6 +7,10 @@ endif(${CMAKE_VERSION} STREQUAL "2.8.2")
 # This can be read from ${PROJECT_NAME} after project() is called
 project(minetest)
 
+set(VERSION_MAJOR 0)
+set(VERSION_MINOR 0)
+set(VERSION_PATCH 1)
+
 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
 include(${CMAKE_SOURCE_DIR}/cmake/Modules/misc.cmake)
 
@@ -52,6 +56,7 @@ install(FILES "minetest.conf.example" DESTINATION "${DOCDIR}")
 
 #
 # Subdirectories
+# Be sure to add all relevant definitions above this
 #
 
 add_subdirectory(src)
@@ -59,11 +64,10 @@ add_subdirectory(src)
 # CPack
 
 set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "An InfiniMiner/Minecraft inspired game")
-set(CPACK_PACKAGE_VERSION_MAJOR 0)
-set(CPACK_PACKAGE_VERSION_MINOR 0)
-set(CPACK_PACKAGE_VERSION_PATCH 0)
+set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
+set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
 set(CPACK_PACKAGE_VENDOR "celeron55")
-set(CPACK_PACKAGE_FILE_NAME "minetest-${BUILD_DATE}")
 
 if(WIN32)
        # For some reason these aren't copied otherwise
@@ -74,6 +78,8 @@ if(WIN32)
                install(FILES bin/minetestserver.exe DESTINATION bin)
        endif()
 
+       set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-win32")
+
        set(CPACK_GENERATOR ZIP)
 
        # This might be needed for some installer
@@ -81,7 +87,7 @@ if(WIN32)
 elseif(APPLE)
        # TODO
        # see http://cmake.org/Wiki/CMake:CPackPackageGenerators#Bundle_.28OSX_only.29
-       set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME})
+       set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-osx")
        set(CPACK_PACKAGE_ICON "")
        set(CPACK_BUNDLE_NAME ${PROJECT_NAME})
        set(CPACK_BUNDLE_ICON "")
@@ -89,6 +95,7 @@ elseif(APPLE)
        set(CPACK_BUNDLE_STARTUP_COMMAND "Contents/MacOS/minetest")
        set(CPACK_GENERATOR BUNDLE)
 else()
+       set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${BUILD_DATE}-linux")
        set(CPACK_GENERATOR TGZ)
        set(CPACK_SOURCE_GENERATOR TGZ)
 endif()
index f5c3ed93bbf01b8ee81d3e7661402afa810f785c..fea1f264410db7d1df536a5e77c11e1709b6803f 100644 (file)
@@ -135,7 +135,9 @@ endif(BUILD_SERVER)
 if( UNIX )
        # Unix
        
-       set(UNIX_FLAGS "-Wall")
+       # NOTE: -Wall gets applied automatically to debug builds
+
+       #set(UNIX_FLAGS "")
 
        if(BUILD_CLIENT)
                set_target_properties(minetest PROPERTIES COMPILE_FLAGS
index 8ac6908742897ebc94bcdeab317554ec050f64c7..9f65386c2abb7a07d0dc75444f60001c79b3791a 100644 (file)
@@ -4,7 +4,8 @@
 #define CONFIG_H
 
 #define INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@"
-#define BUILD_INFO "BUILD_DATE=@BUILD_DATE@ RUN_IN_PLACE=@RUN_IN_PLACE@ 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@"
 
 #endif
 
index 8faa65eb85b7898a9e5437ae9706fa869c47f062..1973bb51062432f41d57b1af830eacaf6c177d4d 100644 (file)
@@ -76,7 +76,7 @@ public:
                        if(g_debugstreams[i] == stderr && m_disable_stderr)
                                continue;
                        if(g_debugstreams[i] != NULL)
-                               fwrite(&c, 1, 1, g_debugstreams[i]);
+                               (void)fwrite(&c, 1, 1, g_debugstreams[i]);
                        //TODO: Is this slow?
                        fflush(g_debugstreams[i]);
                }
@@ -90,7 +90,7 @@ public:
                        if(g_debugstreams[i] == stderr && m_disable_stderr)
                                continue;
                        if(g_debugstreams[i] != NULL)
-                               fwrite(s, 1, n, g_debugstreams[i]);
+                               (void)fwrite(s, 1, n, g_debugstreams[i]);
                        //TODO: Is this slow?
                        fflush(g_debugstreams[i]);
                }
index 4780bf4ec48fa8443c43b7829f6fc375ebbb9dc5..f5e490ad4ccaaa44c833b98d30b6edba1b24a5e9 100644 (file)
@@ -1804,7 +1804,7 @@ continue_generating:
                /*
                        Don't always generate dungeon
                */
-               if(found_existing || rand() % 3 == 0)
+               if(found_existing || rand() % 2 == 0)
                {
                        /*
                                Generate some tunnel starting from orp and ors