Permalink
Browse files

force building blender core with g++ and c++11, part1.

  • Loading branch information...
raptor
raptor committed May 19, 2017
1 parent ba5da77 commit fe0ca1d1442bda3387a35d954836195e5b2e53c4
Showing with 198 additions and 146 deletions.
  1. +17 −5 CMakeLists.txt
  2. +3 −0 source/blender/CMakeLists.txt
  3. +3 −1 source/blender/blenkernel/BKE_multires.h
  4. +3 −1 source/blender/blenkernel/BKE_paint.h
  5. +1 −1 source/blender/blenkernel/BKE_screen.h
  6. +2 −0 source/blender/blenkernel/CMakeLists.txt
  7. +2 −1 source/blender/blenkernel/intern/DerivedMesh.c
  8. +108 −106 source/blender/blenkernel/intern/dynamicpaint.c
  9. +2 −1 source/blender/blenkernel/intern/editderivedmesh.c
  10. +2 −0 source/blender/blenlib/CMakeLists.txt
  11. +29 −10 source/blender/blenlib/intern/BLI_kdopbvh.c
  12. +1 −1 source/blender/editors/screen/area.c
  13. +1 −1 source/blender/editors/space_action/space_action.c
  14. +1 −1 source/blender/editors/space_api/spacetypes.c
  15. +1 −1 source/blender/editors/space_buttons/space_buttons.c
  16. +1 −1 source/blender/editors/space_clip/space_clip.c
  17. +1 −1 source/blender/editors/space_console/space_console.c
  18. +1 −1 source/blender/editors/space_file/space_file.c
  19. +1 −1 source/blender/editors/space_graph/space_graph.c
  20. +1 −1 source/blender/editors/space_image/space_image.c
  21. +1 −1 source/blender/editors/space_info/space_info.c
  22. +1 −1 source/blender/editors/space_logic/space_logic.c
  23. +1 −1 source/blender/editors/space_nla/space_nla.c
  24. +1 −1 source/blender/editors/space_node/space_node.c
  25. +1 −1 source/blender/editors/space_outliner/space_outliner.c
  26. +1 −1 source/blender/editors/space_script/space_script.c
  27. +1 −1 source/blender/editors/space_sequencer/space_sequencer.c
  28. +1 −1 source/blender/editors/space_text/space_text.c
  29. +1 −1 source/blender/editors/space_time/space_time.c
  30. +1 −1 source/blender/editors/space_userpref/space_userpref.c
  31. +1 −1 source/blender/editors/space_view3d/space_view3d.c
  32. +2 −0 source/blender/makesdna/CMakeLists.txt
  33. +2 −0 source/blender/makesrna/CMakeLists.txt
  34. +2 −0 source/blender/modifiers/CMakeLists.txt
View
@@ -47,6 +47,10 @@ endif()
cmake_minimum_required(VERSION 2.8)
+#set(CMAKE_C_COMPILER g++)
+#set(CMAKE_C_COMPILER_INIT g++)
+#set(CMAKE_CXX_COMPILER_INIT g++)
+
if(NOT EXECUTABLE_OUTPUT_PATH)
set(FIRST_RUN TRUE)
else()
@@ -227,10 +231,10 @@ mark_as_advanced(CPACK_OVERRIDE_PACKAGENAME)
mark_as_advanced(BUILDINFO_OVERRIDE_DATE)
mark_as_advanced(BUILDINFO_OVERRIDE_TIME)
-option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" ON)
+option(WITH_IK_ITASC "Enable ITASC IK solver (only disable for development & for incompatible C++ compilers)" OFF)
option(WITH_IK_SOLVER "Enable Legacy IK solver (only disable for development)" ON)
option(WITH_FFTW3 "Enable FFTW3 support (Used for smoke and audio effects)" ${_init_FFTW3})
-option(WITH_BULLET "Enable Bullet (Physics Engine)" ON)
+option(WITH_BULLET "Enable Bullet (Physics Engine)" OFF)
option(WITH_SYSTEM_BULLET "Use the systems bullet library (currently unsupported due to missing features in upstream!)" )
mark_as_advanced(WITH_SYSTEM_BULLET)
option(WITH_GAMEENGINE "Enable Game Engine" ${_init_GAMEENGINE})
@@ -1371,6 +1375,7 @@ endif()
# Extra compile flags
if(CMAKE_COMPILER_IS_GNUCC)
+ #ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_CPP_STYLE -fpermissive)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_CAST_ALIGN -Wcast-align)
@@ -1634,8 +1639,14 @@ if(WITH_ASSERT_ABORT)
add_definitions(-DWITH_ASSERT_ABORT)
endif()
-# message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
-# message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")
+#set(CMAKE_C_FLAGS "-fpermissive -std=c++11 ${CMAKE_C_FLAGS}")
+
+set(CMAKE_C_FLAGS "-fpermissive -std=c++11 -Wall -Wcast-align -Wsign-conversion -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wnonnull -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wuninitialized -Wredundant-decls -Wshadow -Wno-error=unused-but-set-variable -fuse-ld=gold -fopenmp -std=gnu11 -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -msse2")
+
+
+message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
+message(STATUS "Using CXXFLAGS: ${CMAKE_CXX_FLAGS}")
+#exit()
#-----------------------------------------------------------------------------
# Libraries
@@ -1722,7 +1733,8 @@ if(FIRST_RUN)
set(_config_msg "${_config_msg}\n\n ${_text}" PARENT_SCOPE)
endfunction()
- message(STATUS "C Compiler: \"${CMAKE_C_COMPILER_ID}\"")
+ #set(CMAKE_C_COMPILER g++)
+ message(STATUS "C Compiler: \"${CMAKE_C_COMPILER}\"")
message(STATUS "C++ Compiler: \"${CMAKE_CXX_COMPILER_ID}\"")
info_cfg_text("Build Options:")
@@ -23,6 +23,9 @@
#
# ***** END GPL LICENSE BLOCK *****
+## force C++ for all files ##
+#SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
+
set(SRC_DNA_INC
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_ID.h
${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_action_types.h
@@ -32,7 +32,7 @@
* \ingroup bke
*/
-enum MultiresModifiedFlags;
+//enum MultiresModifiedFlags;
struct DerivedMesh;
struct MDisps;
struct Mesh;
@@ -47,6 +47,8 @@ struct MVert;
struct MPoly;
struct MLoopTri;
+#include "BKE_subsurf.h"
+
/* Delete mesh mdisps and grid paint masks */
void multires_customdata_delete(struct Mesh *me);
@@ -58,7 +58,9 @@ struct Tex;
struct ImagePool;
struct UnifiedPaintSettings;
-enum OverlayFlags;
+//enum OverlayFlags;
+#include "DNA_brush_types.h"
+
extern const char PAINT_CURSOR_SCULPT[3];
extern const char PAINT_CURSOR_VERTEX_PAINT[3];
@@ -72,7 +72,7 @@ typedef struct SpaceType {
int iconid; /* icon lookup for menus */
/* initial allocation, after this WM will call init() too */
- struct SpaceLink *(*new)(const struct bContext *C);
+ struct SpaceLink *(*_new)(const struct bContext *C);
/* not free spacelink itself */
void (*free)(struct SpaceLink *);
@@ -23,6 +23,8 @@
#
# ***** END GPL LICENSE BLOCK *****
+SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
+
set(INC
.
../blenfont
@@ -3260,7 +3260,8 @@ void DM_calc_tangents_names_from_gpu(
static void DM_calc_loop_tangents_thread(TaskPool * __restrict UNUSED(pool), void *taskdata, int UNUSED(threadid))
{
- struct SGLSLMeshToTangent *mesh2tangent = taskdata;
+ //struct SGLSLMeshToTangent *mesh2tangent = taskdata;
+ SGLSLMeshToTangent *mesh2tangent = taskdata; // c++ compatible
/* new computation method */
{
SMikkTSpaceContext sContext = {NULL};
Oops, something went wrong.

0 comments on commit fe0ca1d

Please sign in to comment.