CMake/Warnings
authorCampbell Barton <ideasman42@gmail.com>
Tue, 18 Aug 2009 03:24:46 +0000 (03:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 18 Aug 2009 03:24:46 +0000 (03:24 +0000)
* 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

CMakeLists.txt
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/intern/collision.c
source/blender/editors/CMakeLists.txt
source/blender/makesrna/intern/CMakeLists.txt
source/gameengine/Expressions/KX_Python.h
source/gameengine/Expressions/KX_Python_dynamic.h [deleted file]
source/gameengine/Expressions/KX_Python_static.h [deleted file]

index 5e72227982ddf1eeaa574219d4f21c8b9baa2f02..16110e766079fb612f46a263618b509d62b6091e 100644 (file)
@@ -204,6 +204,7 @@ IF(UNIX AND NOT APPLE)
 
   # 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 @@ INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
 
 #-----------------------------------------------------------------------------
 # 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 @@ ADD_SUBDIRECTORY(source/creator)
 IF(WITH_PLAYER)
   ADD_SUBDIRECTORY(blenderplayer)
 ENDIF(WITH_PLAYER)
+
index c1dfc2cf639222fbe78ed2d99923ef38cd37ad43..08d0d40f5bee57a0ba2d48bd48711b57351be9e8 100644 (file)
@@ -30,14 +30,18 @@ SET(INC
   . ../../../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 @@ IF(WITH_DDS)
 ENDIF(WITH_DDS)
 
 IF(WITH_QUICKTIME)
-  SET(INC ${INC} ${QUICKTIME_INC})
+  SET(INC ${INC} ../quicktime ${QUICKTIME_INC})
   ADD_DEFINITIONS(-DWITH_QUICKTIME)
 ENDIF(WITH_QUICKTIME)
 
index c122145c98fff64eca077cfbb687e202117ac1b0..37e9c93a108962885d928134ea6ff59ee3f2ca41 100644 (file)
@@ -591,7 +591,7 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
        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 @@ CollPair* cloth_collision ( ModifierData *md1, ModifierData *md2, BVHTreeOverlap
                                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 );
index fc28e21ab8f61e43916ced5bc607e72a26b5528e..96b6fa5b7ab69f39d7c143b703b8a72d578159f9 100644 (file)
@@ -42,6 +42,10 @@ SET(INC ../windowmanager
   ../blenfont
 )
 
+IF(WITH_GAMEENGINE)
+  ADD_DEFINITIONS(-DGAMEBLENDER)
+ENDIF(WITH_GAMEENGINE)
+
 IF(WITH_INTERNATIONAL)
   ADD_DEFINITIONS(-DINTERNATIONAL)
 ENDIF(WITH_INTERNATIONAL)
index 343df04d4ffc232fbc33fbcf13df8fc12eb28386..152f4031b91042fb58e2fa46f3313a7b5c103198 100644 (file)
@@ -42,6 +42,10 @@ SET(SRC
 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)
index 61f7ef050423915a74bf37da0356052aaac891ae..f41accec730f53da000c97c21d322dd48ebf163d 100644 (file)
 #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
diff --git a/source/gameengine/Expressions/KX_Python_dynamic.h b/source/gameengine/Expressions/KX_Python_dynamic.h
deleted file mode 100644 (file)
index eb435bd..0000000
+++ /dev/null
@@ -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
-
diff --git a/source/gameengine/Expressions/KX_Python_static.h b/source/gameengine/Expressions/KX_Python_static.h
deleted file mode 100644 (file)
index f4f31f9..0000000
+++ /dev/null
@@ -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
-