[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22591] branches/blender2.5/blender: CMake /Warnings

Campbell Barton ideasman42 at gmail.com
Tue Aug 18 05:24:48 CEST 2009


Revision: 22591
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22591
Author:   campbellbarton
Date:     2009-08-18 05:24:46 +0200 (Tue, 18 Aug 2009)

Log Message:
-----------
CMake/Warnings
* WITH_GAMEENGINE and WITH_BULLET were being added to the compiler flags, only define in areas that use them.
* removed C++ unix warnings by adding -Wno-invalid-offsetof -Wno-sign-compare. the py api uses invalid offsets for attributes.
* removed C unix -Wnested-externs warning, these are everywhere in blender.
* removed unused BGE python headers
* undefine _XOPEN_SOURCE and _POSIX_C_SOURCE in the BGE, python redefines.
* renamed USE_BULLET in collision.c to WITH_BULLET for consistency

Modified Paths:
--------------
    branches/blender2.5/blender/CMakeLists.txt
    branches/blender2.5/blender/source/blender/blenkernel/CMakeLists.txt
    branches/blender2.5/blender/source/blender/blenkernel/intern/collision.c
    branches/blender2.5/blender/source/blender/editors/CMakeLists.txt
    branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt
    branches/blender2.5/blender/source/gameengine/Expressions/KX_Python.h

Removed Paths:
-------------
    branches/blender2.5/blender/source/gameengine/Expressions/KX_Python_dynamic.h
    branches/blender2.5/blender/source/gameengine/Expressions/KX_Python_static.h

Modified: branches/blender2.5/blender/CMakeLists.txt
===================================================================
--- branches/blender2.5/blender/CMakeLists.txt	2009-08-18 01:39:49 UTC (rev 22590)
+++ branches/blender2.5/blender/CMakeLists.txt	2009-08-18 03:24:46 UTC (rev 22591)
@@ -204,6 +204,7 @@
 
   # Better warnings
   SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement")
+  SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
 
   INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
 ENDIF(UNIX AND NOT APPLE)
@@ -510,14 +511,8 @@
 
 #-----------------------------------------------------------------------------
 # Extra compile flags
-IF(WITH_GAMEENGINE)
-  SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DGAMEBLENDER ")
-ENDIF(WITH_GAMEENGINE)
-IF(WITH_BULLET)
-  SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} -DWITH_BULLET ")
-ENDIF(WITH_BULLET)
 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS} ${C_WARNINGS}")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${PLATFORM_CFLAGS} ${CXX_WARNINGS}")
 
 #-----------------------------------------------------------------------------
 # Libraries
@@ -537,3 +532,4 @@
 IF(WITH_PLAYER)
   ADD_SUBDIRECTORY(blenderplayer)
 ENDIF(WITH_PLAYER)
+

Modified: branches/blender2.5/blender/source/blender/blenkernel/CMakeLists.txt
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/CMakeLists.txt	2009-08-18 01:39:49 UTC (rev 22590)
+++ branches/blender2.5/blender/source/blender/blenkernel/CMakeLists.txt	2009-08-18 03:24:46 UTC (rev 22591)
@@ -30,14 +30,18 @@
   . ../../../intern/guardedalloc ../../../intern/memutil ../editors/include ../blenlib ../makesdna
   ../render/extern/include ../../../intern/decimation/extern
   ../imbuf ../avi ../../../intern/elbeem/extern ../../../intern/opennl/extern
-  ../../../intern/iksolver/extern ../blenloader ../quicktime
-  ../../../extern/bullet2/src
+  ../../../intern/iksolver/extern ../blenloader
   ../nodes ../../../extern/glew/include ../gpu ../makesrna ../../../intern/smoke/extern
   ../../../intern/bsp/extern
   ../../../intern/audaspace/intern
   ${ZLIB_INC}
 )
 
+IF(WITH_BULLET)
+  SET(INC ${INC} ../../../extern/bullet2/src)
+  ADD_DEFINITIONS(-DWITH_BULLET)
+ENDIF(WITH_BULLET)
+
 IF(WITH_OPENEXR)
   ADD_DEFINITIONS(-DWITH_OPENEXR)
 ENDIF(WITH_OPENEXR)
@@ -51,7 +55,7 @@
 ENDIF(WITH_DDS)
 
 IF(WITH_QUICKTIME)
-  SET(INC ${INC} ${QUICKTIME_INC})
+  SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
   ADD_DEFINITIONS(-DWITH_QUICKTIME)
 ENDIF(WITH_QUICKTIME)
 

Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/collision.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/collision.c	2009-08-18 01:39:49 UTC (rev 22590)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/collision.c	2009-08-18 03:24:46 UTC (rev 22591)
@@ -591,7 +591,7 @@
 	ClothModifierData *clmd = ( ClothModifierData * ) md1;
 	CollisionModifierData *collmd = ( CollisionModifierData * ) md2;
 	MFace *face1=NULL, *face2 = NULL;
-#ifdef WITH_BULLET
+#ifdef USE_BULLET
 	ClothVertex *verts1 = clmd->clothObject->verts;
 #endif
 	double distance = 0;
@@ -669,7 +669,7 @@
 				break;
 		}
 
-#ifdef WITH_BULLET
+#ifdef USE_BULLET
 		// calc distance + normal
 		distance = plNearestPoints (
 			verts1[collpair->ap1].txold, verts1[collpair->ap2].txold, verts1[collpair->ap3].txold, collmd->current_x[collpair->bp1].co, collmd->current_x[collpair->bp2].co, collmd->current_x[collpair->bp3].co, collpair->pa,collpair->pb,collpair->vector );

Modified: branches/blender2.5/blender/source/blender/editors/CMakeLists.txt
===================================================================
--- branches/blender2.5/blender/source/blender/editors/CMakeLists.txt	2009-08-18 01:39:49 UTC (rev 22590)
+++ branches/blender2.5/blender/source/blender/editors/CMakeLists.txt	2009-08-18 03:24:46 UTC (rev 22591)
@@ -42,6 +42,10 @@
   ../blenfont
 )
 
+IF(WITH_GAMEENGINE)
+  ADD_DEFINITIONS(-DGAMEBLENDER)
+ENDIF(WITH_GAMEENGINE)
+
 IF(WITH_INTERNATIONAL)
   ADD_DEFINITIONS(-DINTERNATIONAL)
 ENDIF(WITH_INTERNATIONAL)

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt	2009-08-18 01:39:49 UTC (rev 22590)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/CMakeLists.txt	2009-08-18 03:24:46 UTC (rev 22591)
@@ -42,6 +42,10 @@
 INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .)
 FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h)
 
+IF(WITH_GAMEENGINE)
+  ADD_DEFINITIONS(-DGAMEBLENDER)
+ENDIF(WITH_GAMEENGINE)
+
 IF(WITH_OPENEXR)
   ADD_DEFINITIONS(-DWITH_OPENEXR)
 ENDIF(WITH_OPENEXR)

Modified: branches/blender2.5/blender/source/gameengine/Expressions/KX_Python.h
===================================================================
--- branches/blender2.5/blender/source/gameengine/Expressions/KX_Python.h	2009-08-18 01:39:49 UTC (rev 22590)
+++ branches/blender2.5/blender/source/gameengine/Expressions/KX_Python.h	2009-08-18 03:24:46 UTC (rev 22591)
@@ -30,6 +30,17 @@
 #define KX_PYTHON_H
 
 //#define USE_DL_EXPORT
+
+/* python redefines, quiet the compiler */
+#ifdef _XOPEN_SOURCE
+#undef _XOPEN_SOURCE
+#endif
+
+#ifdef _POSIX_C_SOURCE
+#undef _POSIX_C_SOURCE
+#endif
+
+
 #include "Python.h"
 
 #define USE_MATHUTILS // Blender 2.5x api will use mathutils, for a while we might want to test without it

Deleted: branches/blender2.5/blender/source/gameengine/Expressions/KX_Python_dynamic.h
===================================================================
--- branches/blender2.5/blender/source/gameengine/Expressions/KX_Python_dynamic.h	2009-08-18 01:39:49 UTC (rev 22590)
+++ branches/blender2.5/blender/source/gameengine/Expressions/KX_Python_dynamic.h	2009-08-18 03:24:46 UTC (rev 22591)
@@ -1,36 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef KX_PYTHON_H
-#define KX_PYTHON_H
-
-//#define USE_DL_EXPORT
-#include "Python.h"
-
-#endif // KX_PYTHON_H
-

Deleted: branches/blender2.5/blender/source/gameengine/Expressions/KX_Python_static.h
===================================================================
--- branches/blender2.5/blender/source/gameengine/Expressions/KX_Python_static.h	2009-08-18 01:39:49 UTC (rev 22590)
+++ branches/blender2.5/blender/source/gameengine/Expressions/KX_Python_static.h	2009-08-18 03:24:46 UTC (rev 22591)
@@ -1,36 +0,0 @@
-/**
- * $Id$
- *
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-#ifndef KX_PYTHON_H
-#define KX_PYTHON_H
-
-#define USE_DL_EXPORT
-#include "Python.h"
-
-#endif // KX_PYTHON_H
-





More information about the Bf-blender-cvs mailing list