diff --git a/CMakeLists.txt b/CMakeLists.txt index 1aaec87f7c3..a8673c926f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -543,25 +543,28 @@ IF(WIN32) SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /NODEFAULTLIB:libcmt.lib;libc.lib ") - ELSE(MSVC) # MINGW - SET(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid") - SET(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing") + ELSE(MSVC) + # keep GCC spesific stuff here + IF(CMAKE_COMPILER_IS_GNUCC) + SET(LLIBS "-lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid") + SET(PLATFORM_CFLAGS "-pipe -funsigned-char -fno-strict-aliasing") - # Better warnings - SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas") - SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare") + # Better warnings + SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement -Wno-unknown-pragmas") + SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare") + + IF(WITH_OPENMP) + SET(LLIBS "${LLIBS} -lgomp") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") + ENDIF(WITH_OPENMP) + ENDIF(CMAKE_COMPILER_IS_GNUCC) ADD_DEFINITIONS(-DFREE_WINDOWS) SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") - IF(WITH_OPENMP) - SET(LLIBS "${LLIBS} -lgomp") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fopenmp") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fopenmp") - ENDIF(WITH_OPENMP) - IF(WITH_INTERNATIONAL) SET(GETTEXT ${LIBDIR}/gcc/gettext) SET(GETTEXT_INC ${GETTEXT}/include) diff --git a/source/blender/blenkernel/BKE_utildefines.h b/source/blender/blenkernel/BKE_utildefines.h index a7b4a71c84d..a1968459fd6 100644 --- a/source/blender/blenkernel/BKE_utildefines.h +++ b/source/blender/blenkernel/BKE_utildefines.h @@ -282,7 +282,7 @@ behaviour, though it may not be the best in practice. #elif defined(__GNUC__) #define BM_INLINE static inline __attribute((always_inline)) #else -#warning "MSC/GNUC defines not found, inline non-functional" +/* #warning "MSC/GNUC defines not found, inline non-functional" */ #define BM_INLINE static #endif diff --git a/source/blender/python/generic/mathutils.c b/source/blender/python/generic/mathutils.c index 4f54ee9e90e..73f16cb0cf1 100644 --- a/source/blender/python/generic/mathutils.c +++ b/source/blender/python/generic/mathutils.c @@ -248,6 +248,7 @@ static struct PyModuleDef M_Mathutils_module_def = { PyMODINIT_FUNC BPyInit_mathutils(void) { PyObject *submodule; + PyObject *item; if( PyType_Ready( &vector_Type ) < 0 ) return NULL; @@ -270,8 +271,13 @@ PyMODINIT_FUNC BPyInit_mathutils(void) PyModule_AddObject( submodule, "Color", (PyObject *)&color_Type ); /* submodule */ - PyModule_AddObject( submodule, "geometry", BPyInit_mathutils_geometry()); - + PyModule_AddObject( submodule, "geometry", (item=BPyInit_mathutils_geometry())); + /* XXX, python doesnt do imports with this usefully yet + * 'from mathutils.geometry import PolyFill' + * ...fails without this. */ + PyDict_SetItemString(PyThreadState_GET()->interp->modules, "mathutils.geometry", item); + Py_INCREF(item); + mathutils_matrix_vector_cb_index= Mathutils_RegisterCallback(&mathutils_matrix_vector_cb); return submodule; diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index ab8a355be47..a894fa60237 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -199,6 +199,7 @@ void BPY_set_context(bContext *C) /* init-tab */ extern PyObject *BPyInit_noise(void); extern PyObject *BPyInit_mathutils(void); +// extern PyObject *BPyInit_mathutils_geometry(void); // BPyInit_mathutils calls, py doesnt work with thos :S extern PyObject *BPyInit_bgl(void); extern PyObject *BPyInit_blf(void); extern PyObject *AUD_initPython(void); @@ -206,6 +207,7 @@ extern PyObject *AUD_initPython(void); static struct _inittab bpy_internal_modules[]= { {"noise", BPyInit_noise}, {"mathutils", BPyInit_mathutils}, +// {"mathutils.geometry", BPyInit_mathutils_geometry}, {"bgl", BPyInit_bgl}, {"blf", BPyInit_blf}, {"aud", AUD_initPython},