diff options
author | ShadowNinja <shadowninja@minetest.net> | 2015-02-27 18:05:29 -0500 |
---|---|---|
committer | ShadowNinja <shadowninja@minetest.net> | 2015-03-27 15:00:48 -0400 |
commit | 93fcab952b28f4db39d9326b83f14cbd86c0cf17 (patch) | |
tree | 4a2f0fcf7341c596f50ec24ff0a5a81d43d17ccd /src/config.h | |
parent | 284fefb0c32e8222fadd78eeec6e7e718fe25668 (diff) | |
download | minetest-93fcab952b28f4db39d9326b83f14cbd86c0cf17.tar.gz minetest-93fcab952b28f4db39d9326b83f14cbd86c0cf17.tar.bz2 minetest-93fcab952b28f4db39d9326b83f14cbd86c0cf17.zip |
Clean up and tweak build system
* Combine client and server man pages.
* Update unit test options and available databases in man page.
* Add `--worldname` to man page.
* Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`.
* Disable server build by default on all operating systems.
* Make `ENABLE_FREETYPE` not fail if FreeType isn't found.
* Enable LevelDB, Redis, and FreeType detection by default.
* Remove the `VERSION_PATCH_ORIG` hack.
* Add option to search for and use system JSONCPP.
* Remove broken LuaJIT version detection.
* Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`.
* Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`.
* Clean up style of CMake files.
Diffstat (limited to 'src/config.h')
-rw-r--r-- | src/config.h | 89 |
1 files changed, 25 insertions, 64 deletions
diff --git a/src/config.h b/src/config.h index b07aa5d22..ac7684e20 100644 --- a/src/config.h +++ b/src/config.h @@ -6,82 +6,43 @@ #ifndef CONFIG_H #define CONFIG_H -#define PROJECT_NAME "Minetest" -#define RUN_IN_PLACE 0 -#define STATIC_SHAREDIR "" +#define STRINGIFY(x) #x +#define STR(x) STRINGIFY(x) -#define USE_GETTEXT 0 -#ifndef USE_SOUND - #define USE_SOUND 0 -#endif - -#ifndef USE_CURL +#ifdef USE_CMAKE_CONFIG_H + #include "cmake_config.h" +#else + #define PROJECT_NAME "Minetest" + #define RUN_IN_PLACE 0 #define USE_CURL 0 -#endif - -#ifndef USE_FREETYPE #define USE_FREETYPE 0 -#endif - -#ifndef USE_LEVELDB + #define USE_GETTEXT 0 #define USE_LEVELDB 0 -#endif - -#ifndef USE_LUAJIT #define USE_LUAJIT 0 -#endif - -#ifndef USE_REDIS #define USE_REDIS 0 -#endif - -#define HAVE_ENDIAN_H 0 - -#ifdef USE_CMAKE_CONFIG_H - #include "cmake_config.h" - #undef PROJECT_NAME - #define PROJECT_NAME CMAKE_PROJECT_NAME - #undef RUN_IN_PLACE - #define RUN_IN_PLACE CMAKE_RUN_IN_PLACE - #undef USE_GETTEXT - #define USE_GETTEXT CMAKE_USE_GETTEXT - #undef USE_SOUND - #define USE_SOUND CMAKE_USE_SOUND - #undef USE_CURL - #define USE_CURL CMAKE_USE_CURL - #undef USE_FREETYPE - #define USE_FREETYPE CMAKE_USE_FREETYPE - #undef STATIC_SHAREDIR - #define STATIC_SHAREDIR CMAKE_STATIC_SHAREDIR - #undef USE_LEVELDB - #define USE_LEVELDB CMAKE_USE_LEVELDB - #undef USE_LUAJIT - #define USE_LUAJIT CMAKE_USE_LUAJIT - #undef USE_REDIS - #define USE_REDIS CMAKE_USE_REDIS - #undef VERSION_MAJOR - #define VERSION_MAJOR CMAKE_VERSION_MAJOR - #undef VERSION_MINOR - #define VERSION_MINOR CMAKE_VERSION_MINOR - #undef VERSION_PATCH - #define VERSION_PATCH CMAKE_VERSION_PATCH - #undef VERSION_PATCH_ORIG - #define VERSION_PATCH_ORIG CMAKE_VERSION_PATCH_ORIG - #undef VERSION_STRING - #define VERSION_STRING CMAKE_VERSION_STRING - #undef PRODUCT_VERSION_STRING - #define PRODUCT_VERSION_STRING CMAKE_PRODUCT_VERSION_STRING - #undef VERSION_EXTRA_STRING - #define VERSION_EXTRA_STRING CMAKE_VERSION_EXTRA_STRING - #undef HAVE_ENDIAN_H - #define HAVE_ENDIAN_H CMAKE_HAVE_ENDIAN_H + #define USE_SOUND 0 + #define HAVE_ENDIAN_H 0 + #define STATIC_SHAREDIR "" + #ifdef NDEBUG + #define BUILD_TYPE "Release" + #else + #define BUILD_TYPE "Debug" + #endif #endif #ifdef __ANDROID__ #include "android_version.h" - #define VERSION_STRING CMAKE_VERSION_STRING #endif +#define BUILD_INFO "BUILD_TYPE=" BUILD_TYPE \ + " RUN_IN_PLACE=" STR(RUN_IN_PLACE) \ + " USE_GETTEXT=" STR(USE_GETTEXT) \ + " USE_SOUND=" STR(USE_SOUND) \ + " USE_CURL=" STR(USE_CURL) \ + " USE_FREETYPE=" STR(USE_FREETYPE) \ + " USE_LUAJIT=" STR(USE_LUAJIT) \ + " STATIC_SHAREDIR=" STR(STATIC_SHAREDIR) + #endif |