Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-08-18 07:24:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-18 07:24:46 +0400
commit0dad5cfbcafeaa45b59b581dc217fe2ebd297f2d (patch)
tree4fc8452da587d4d103a8a25512a778299c29ed0e
parentca20107edb7e80a9a87f1e7a3a38ae2ed63a3d4b (diff)
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
-rw-r--r--CMakeLists.txt10
-rw-r--r--source/blender/blenkernel/CMakeLists.txt10
-rw-r--r--source/blender/blenkernel/intern/collision.c4
-rw-r--r--source/blender/editors/CMakeLists.txt4
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt4
-rw-r--r--source/gameengine/Expressions/KX_Python.h11
-rw-r--r--source/gameengine/Expressions/KX_Python_dynamic.h36
-rw-r--r--source/gameengine/Expressions/KX_Python_static.h36
8 files changed, 31 insertions, 84 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5e72227982d..16110e76607 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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)
+
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index c1dfc2cf639..08d0d40f5be 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -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)
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index c122145c98f..37e9c93a108 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -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 );
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt
index fc28e21ab8f..96b6fa5b7ab 100644
--- a/source/blender/editors/CMakeLists.txt
+++ b/source/blender/editors/CMakeLists.txt
@@ -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)
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 343df04d4ff..152f4031b91 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -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)
diff --git a/source/gameengine/Expressions/KX_Python.h b/source/gameengine/Expressions/KX_Python.h
index 61f7ef05042..f41accec730 100644
--- a/source/gameengine/Expressions/KX_Python.h
+++ b/source/gameengine/Expressions/KX_Python.h
@@ -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
diff --git a/source/gameengine/Expressions/KX_Python_dynamic.h b/source/gameengine/Expressions/KX_Python_dynamic.h
deleted file mode 100644
index eb435bdf1c3..00000000000
--- a/source/gameengine/Expressions/KX_Python_dynamic.h
+++ /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
index f4f31f9b058..00000000000
--- a/source/gameengine/Expressions/KX_Python_static.h
+++ /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
-