[Orxonox-commit 3682] r8363 - in code/trunk: . cmake/tools src src/external/tolua/lua
rgrieder at orxonox.net
rgrieder at orxonox.net
Sat Apr 30 04:36:04 CEST 2011
Author: rgrieder
Date: 2011-04-30 04:36:04 +0200 (Sat, 30 Apr 2011)
New Revision: 8363
Modified:
code/trunk/CMakeLists.txt
code/trunk/cmake/tools/GenerateToluaBindings.cmake
code/trunk/src/OrxonoxConfig.cmake
code/trunk/src/OrxonoxConfig.h.in
code/trunk/src/external/tolua/lua/package.lua
Log:
To avoid further confusion, I linked ORXONOX_RELEASE to the 'Release' and 'MinSizeRel' configurations. The variable is therefore not anymore available in CMake.
That means defining what these configurations actually mean in the context of Orxonox:
Debug: No optimisations and additional debug information. NOT distributable.
RelWithDebInfo: Optimisations enabled, but also generates debug information. Should be the default mode for development.
Release: With optimisations, but no debug symbols. Use this configuration to make a release binary.
MinSizeRel: Like Release, but optimised for size instead of speed. Not really useful for us.
Modified: code/trunk/CMakeLists.txt
===================================================================
--- code/trunk/CMakeLists.txt 2011-04-30 02:02:27 UTC (rev 8362)
+++ code/trunk/CMakeLists.txt 2011-04-30 02:36:04 UTC (rev 8363)
@@ -110,9 +110,6 @@
# Debug builds can not be installed
INSTALL(SCRIPT cmake/InstallCheck.cmake)
-# Enable expensive optimisations: use this for a binary release build
-OPTION(ORXONOX_RELEASE "Enable when building restributable releases" FALSE)
-
IF(APPLE)
# Set 10.5 as the base SDK by default
SET(XCODE_ATTRIBUTE_SDKROOT macosx10.5)
Modified: code/trunk/cmake/tools/GenerateToluaBindings.cmake
===================================================================
--- code/trunk/cmake/tools/GenerateToluaBindings.cmake 2011-04-30 02:02:27 UTC (rev 8362)
+++ code/trunk/cmake/tools/GenerateToluaBindings.cmake 2011-04-30 02:36:04 UTC (rev 8363)
@@ -62,11 +62,6 @@
SET_SOURCE_FILES_PROPERTIES(${_tolua_cxxfile} PROPERTIES COMPILE_FLAGS "-w")
ENDIF()
- # Tolua binding speedup if required
- IF(ORXONOX_RELEASE)
- SET_SOURCE_FILES_PROPERTIES(${_tolua_cxxfile} PROPERTIES COMPILE_FLAGS "-DTOLUA_RELEASE")
- ENDIF()
-
# Create temporary package file and implicit dependencies
FILE(REMOVE ${_tolua_pkgfile})
FOREACH(_tolua_inputfile ${_tolua_inputfiles})
Modified: code/trunk/src/OrxonoxConfig.cmake
===================================================================
--- code/trunk/src/OrxonoxConfig.cmake 2011-04-30 02:02:27 UTC (rev 8362)
+++ code/trunk/src/OrxonoxConfig.cmake 2011-04-30 02:36:04 UTC (rev 8363)
@@ -71,6 +71,13 @@
# Part of a woraround for OS X warnings. See OrxonoxConfig.h.in
SET(ORX_HAVE_STDINT_H ${HAVE_STDINT_H})
+# XCode and Visual Studio support multiple configurations. In order to tell
+# about the active one we have to define the macro for each configuration
+ADD_COMPILER_FLAGS("-DCMAKE_Debug_BUILD" Debug)
+ADD_COMPILER_FLAGS("-DCMAKE_Release_BUILD" Release)
+ADD_COMPILER_FLAGS("-DCMAKE_RelWithDebInfo_BUILD" RelWithDebInfo)
+ADD_COMPILER_FLAGS("-DCMAKE_MinSizeRel_BUILD" MinSizeRel)
+
IF(MSVC)
# Check whether we can use Visual Leak Detector
FIND_FILE(VLD_DLL vld_x86.dll)
Modified: code/trunk/src/OrxonoxConfig.h.in
===================================================================
--- code/trunk/src/OrxonoxConfig.h.in 2011-04-30 02:02:27 UTC (rev 8362)
+++ code/trunk/src/OrxonoxConfig.h.in 2011-04-30 02:36:04 UTC (rev 8363)
@@ -145,12 +145,6 @@
/*---------------------------------
- * Options
- *-------------------------------*/
-#cmakedefine ORXONOX_RELEASE ///< Enables expensive (build time) optimisations and disables certain features
-
-
-/*---------------------------------
* Includes and Declarations
*-------------------------------*/
// Define the english written operators like and, or, xor
@@ -184,9 +178,16 @@
#endif
*/
+// Configurations Release and MinSizeRel are designed for redistribution while
+// RelWithDebInfo is more for development
+// ORXONOX_RELEASE simplifies this a little bit
+#if defined(CMAKE_Release_BUILD) || defined(CMAKE_MinSizeRel_BUILD)
+# define ORXONOX_RELEASE
+#endif
+
// Include memory leak detector if available and not building actual release
#cmakedefine HAVE_VLD
-#if defined(HAVE_VLD) && !defined(ORXONOX_RELEASE)
+#if defined(HAVE_VLD) && !defined(NDEBUG)
typedef uint32_t UINT32;
typedef wchar_t WCHAR;
struct HINSTANCE__;
Modified: code/trunk/src/external/tolua/lua/package.lua
===================================================================
--- code/trunk/src/external/tolua/lua/package.lua 2011-04-30 02:02:27 UTC (rev 8362)
+++ code/trunk/src/external/tolua/lua/package.lua 2011-04-30 02:36:04 UTC (rev 8363)
@@ -135,6 +135,11 @@
i = i+1
end
+ output('\n')
+ output('#ifdef ORXONOX_RELEASE\n')
+ output('# define TOLUA_RELEASE\n')
+ output('#endif\n')
+
if self:requirecollection(_collect) then
output('\n')
output('/* function to release collected object via destructor */')
More information about the Orxonox-commit
mailing list