Permalink
Browse files

refactored cmake to set build flags per submodule and file.

made most header c++ compatible.
  • Loading branch information...
raptor raptor
raptor authored and raptor committed May 22, 2017
1 parent 2c845d2 commit 0906f4919a68e95d76ad918e60e6fa2f6fc338de
Showing with 556 additions and 52 deletions.
  1. +5 −2 CMakeLists.txt
  2. +2 −0 source/blender/blenkernel/BKE_appdir.h
  3. +3 −1 source/blender/blenkernel/BKE_armature.h
  4. +2 −1 source/blender/blenkernel/BKE_curve.h
  5. +2 −0 source/blender/blenkernel/BKE_customdata_file.h
  6. +2 −0 source/blender/blenkernel/BKE_deform.h
  7. +2 −0 source/blender/blenkernel/BKE_image.h
  8. +2 −0 source/blender/blenkernel/BKE_key.h
  9. +1 −1 source/blender/blenkernel/BKE_main.h
  10. +1 −0 source/blender/blenkernel/BKE_mesh_mapping.h
  11. +1 −0 source/blender/blenkernel/BKE_mesh_remap.h
  12. +1 −0 source/blender/blenkernel/BKE_nla.h
  13. +2 −1 source/blender/blenkernel/BKE_object_deform.h
  14. +1 −0 source/blender/blenkernel/BKE_property.h
  15. +2 −0 source/blender/blenkernel/BKE_scene.h
  16. +1 −1 source/blender/blenkernel/BKE_screen.h
  17. +2 −2 source/blender/blenkernel/BKE_shrinkwrap.h
  18. +2 −0 source/blender/blenkernel/BKE_sketch.h
  19. +1 −0 source/blender/blenkernel/BKE_unit.h
  20. +17 −1 source/blender/blenkernel/CMakeLists.txt
  21. +2 −0 source/blender/blenlib/BLI_array_store.h
  22. +1 −0 source/blender/blenlib/BLI_array_store_utils.h
  23. +1 −0 source/blender/blenlib/BLI_array_utils.h
  24. +1 −1 source/blender/blenlib/BLI_astar.h
  25. +1 −0 source/blender/blenlib/BLI_buffer.h
  26. +2 −0 source/blender/blenlib/BLI_edgehash.h
  27. +1 −0 source/blender/blenlib/BLI_endian_switch.h
  28. +1 −0 source/blender/blenlib/BLI_fileops.h
  29. +1 −0 source/blender/blenlib/BLI_ghash.h
  30. +1 −0 source/blender/blenlib/BLI_gsqueue.h
  31. +2 −0 source/blender/blenlib/BLI_hash_md5.h
  32. +12 −12 source/blender/blenlib/BLI_heap.h
  33. +23 −1 source/blender/blenlib/CMakeLists.txt
  34. +5 −1 source/blender/blenloader/CMakeLists.txt
  35. +51 −1 source/blender/bmesh/CMakeLists.txt
  36. +2 −0 source/blender/bmesh/intern/bmesh_callback_generic.h
  37. +3 −0 source/blender/bmesh/intern/bmesh_construct.h
  38. +1 −1 source/blender/editors/CMakeLists.txt
  39. +4 −0 source/blender/editors/animation/CMakeLists.txt
  40. +2 −0 source/blender/editors/animation/anim_intern.h
  41. +4 −0 source/blender/editors/armature/CMakeLists.txt
  42. +3 −1 source/blender/editors/armature/armature_intern.h
  43. +4 −0 source/blender/editors/curve/CMakeLists.txt
  44. +2 −0 source/blender/editors/curve/curve_intern.h
  45. +4 −0 source/blender/editors/gpencil/CMakeLists.txt
  46. +6 −3 source/blender/editors/gpencil/gpencil_intern.h
  47. +2 −0 source/blender/editors/include/ED_anim_api.h
  48. +1 −0 source/blender/editors/include/ED_curve.h
  49. +2 −1 source/blender/editors/include/ED_gpencil.h
  50. +1 −1 source/blender/editors/include/ED_keyframes_draw.h
  51. +2 −1 source/blender/editors/include/ED_keyframes_edit.h
  52. +1 −0 source/blender/editors/include/ED_markers.h
  53. +3 −0 source/blender/editors/include/ED_mask.h
  54. +2 −0 source/blender/editors/include/ED_mesh.h
  55. +1 −0 source/blender/editors/include/ED_node.h
  56. +1 −2 source/blender/editors/include/ED_object.h
  57. +2 −1 source/blender/editors/include/ED_screen_types.h
  58. +2 −0 source/blender/editors/include/ED_view3d.h
  59. +4 −0 source/blender/editors/interface/CMakeLists.txt
  60. +3 −1 source/blender/editors/interface/interface_intern.h
  61. +4 −0 source/blender/editors/mask/CMakeLists.txt
  62. +2 −1 source/blender/editors/mask/mask_intern.h
  63. +4 −0 source/blender/editors/mesh/CMakeLists.txt
  64. +4 −1 source/blender/editors/metaball/CMakeLists.txt
  65. +4 −0 source/blender/editors/object/CMakeLists.txt
  66. +4 −0 source/blender/editors/physics/CMakeLists.txt
  67. +4 −0 source/blender/editors/render/CMakeLists.txt
  68. +4 −0 source/blender/editors/screen/CMakeLists.txt
  69. +8 −0 source/blender/editors/screen/screen_intern.h
  70. +4 −0 source/blender/editors/sculpt_paint/CMakeLists.txt
  71. +1 −1 source/blender/editors/sculpt_paint/sculpt_intern.h
  72. +4 −0 source/blender/editors/space_action/CMakeLists.txt
  73. +4 −0 source/blender/editors/space_buttons/CMakeLists.txt
  74. +4 −0 source/blender/editors/space_clip/CMakeLists.txt
  75. +4 −0 source/blender/editors/space_graph/CMakeLists.txt
  76. +4 −0 source/blender/editors/space_image/CMakeLists.txt
  77. +4 −0 source/blender/editors/space_info/CMakeLists.txt
  78. +4 −0 source/blender/editors/space_logic/CMakeLists.txt
  79. +4 −0 source/blender/editors/space_nla/CMakeLists.txt
  80. +9 −0 source/blender/editors/space_nla/nla_intern.h
  81. +4 −0 source/blender/editors/space_node/CMakeLists.txt
  82. +4 −0 source/blender/editors/space_outliner/CMakeLists.txt
  83. +1 −0 source/blender/editors/space_outliner/outliner_intern.h
  84. +4 −0 source/blender/editors/space_time/CMakeLists.txt
  85. +4 −0 source/blender/editors/space_view3d/CMakeLists.txt
  86. +2 −0 source/blender/editors/space_view3d/view3d_intern.h
  87. +4 −0 source/blender/editors/transform/CMakeLists.txt
  88. +7 −0 source/blender/editors/util/CMakeLists.txt
  89. +4 −0 source/blender/editors/uvedit/CMakeLists.txt
  90. +21 −1 source/blender/gpu/CMakeLists.txt
  91. +5 −1 source/blender/ikplugin/CMakeLists.txt
  92. +1 −1 source/blender/makesdna/CMakeLists.txt
  93. +3 −0 source/blender/makesdna/intern/CMakeLists.txt
  94. +1 −1 source/blender/makesrna/CMakeLists.txt
  95. +6 −0 source/blender/makesrna/intern/CMakeLists.txt
  96. +16 −1 source/blender/modifiers/CMakeLists.txt
  97. +5 −1 source/blender/nodes/CMakeLists.txt
  98. +5 −1 source/blender/physics/CMakeLists.txt
  99. +1 −1 source/blender/python/CMakeLists.txt
  100. +16 −0 source/blender/python/bmesh/CMakeLists.txt
  101. +41 −0 source/blender/python/intern/CMakeLists.txt
  102. +17 −0 source/blender/python/mathutils/CMakeLists.txt
  103. +41 −1 source/blender/render/CMakeLists.txt
  104. +3 −0 source/blender/render/extern/include/RE_bake.h
  105. +2 −0 source/blender/render/extern/include/RE_multires_bake.h
  106. +1 −0 source/blender/render/extern/include/RE_pipeline.h
  107. +1 −1 source/blender/render/intern/include/initrender.h
  108. +1 −0 source/blender/render/intern/include/pixelblending.h
  109. +1 −0 source/blender/render/intern/include/pixelshading.h
  110. +2 −0 source/blender/render/intern/include/renderdatabase.h
  111. +1 −0 source/blender/render/intern/include/shading.h
  112. +5 −1 source/blender/windowmanager/CMakeLists.txt
  113. +8 −0 source/blender/windowmanager/wm.h
  114. +9 −0 source/blender/windowmanager/wm_event_system.h
  115. +2 −0 source/blender/windowmanager/wm_subwindow.h
  116. +4 −0 source/blender/windowmanager/wm_window.h
View
@@ -47,8 +47,10 @@ endif()
cmake_minimum_required(VERSION 2.8)
set(WITH_CPP_DEV OFF)
set(WITH_CPP_CORE OFF)
if(NOT EXECUTABLE_OUTPUT_PATH)
set(FIRST_RUN TRUE)
else()
@@ -1637,9 +1639,10 @@ if(WITH_ASSERT_ABORT)
add_definitions(-DWITH_ASSERT_ABORT)
endif()
#set(CMAKE_C_FLAGS "-fpermissive -std=c++11 ${CMAKE_C_FLAGS}")
if (WITH_CPP_CORE)
if (WITH_CPP_DEV)
set(CMAKE_C_FLAGS "-fpermissive -std=c++11 -Wall -Wconversion -Wcast-align -Wsign-conversion -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -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")
elseif(WITH_CPP_CORE)
set(CMAKE_CXX_FLAGS "-fpermissive -std=c++11 ${CMAKE_CXX_FLAGS}")
endif()
message(STATUS "Using CFLAGS: ${CMAKE_C_FLAGS}")
@@ -20,6 +20,8 @@
#ifndef __BKE_APPDIR_H__
#define __BKE_APPDIR_H__
#include "BLI_sys_types.h"
/** \file BKE_appdir.h
* \ingroup bli
*/
@@ -33,6 +33,8 @@
* \author nzc
*/
#include "DNA_listBase.h"
struct Bone;
struct GHash;
struct Main;
@@ -42,7 +44,7 @@ struct bConstraint;
struct Scene;
struct Object;
struct PoseTree;
struct ListBase;
//struct ListBase;
typedef struct PoseTarget {
struct PoseTarget *next, *prev;
@@ -32,11 +32,12 @@
* \since March 2001
* \author nzc
*/
#include "DNA_listBase.h"
struct BezTriple;
struct Curve;
struct EditNurb;
struct ListBase;
//struct ListBase;
struct Main;
struct Nurb;
struct Object;
@@ -21,6 +21,8 @@
#ifndef __BKE_CUSTOMDATA_FILE_H__
#define __BKE_CUSTOMDATA_FILE_H__
#include "BLI_sys_types.h"
/** \file BKE_customdata_file.h
* \ingroup bke
*/
@@ -35,6 +35,8 @@
* \brief support for deformation groups and hooks.
*/
#include "DNA_object_types.h"
struct Object;
struct ListBase;
struct bDeformGroup;
@@ -32,6 +32,8 @@
* \since March 2001
* \author nzc
*/
#include "BLI_sys_types.h"
#ifdef __cplusplus
extern "C" {
@@ -32,6 +32,8 @@
* \since March 2001
* \author nzc
*/
#include "BLI_sys_types.h"
struct Key;
struct KeyBlock;
struct ID;
@@ -41,7 +41,7 @@
*
*/
#include "DNA_listBase.h"
#include "BLI_sys_types.h"
#include "BKE_library.h"
#ifdef __cplusplus
@@ -30,6 +30,7 @@
/** \file BKE_mesh_mapping.h
* \ingroup bke
*/
#include "BLI_sys_types.h"
struct MVert;
struct MEdge;
@@ -24,6 +24,7 @@
/** \file BKE_mesh_remap.h
* \ingroup bke
*/
#include "BKE_mesh_mapping.h"
struct CustomData;
struct DerivedMesh;
@@ -39,6 +39,7 @@ struct NlaTrack;
struct bAction;
struct Scene;
struct Speaker;
struct ListBase;
/* ----------------------------- */
/* Data Management */
@@ -28,6 +28,7 @@
* \brief Functions for dealing with objects and deform verts,
* used by painting and tools.
*/
#include "DNA_scene_types.h"
#ifdef __cplusplus
extern "C" {
@@ -57,7 +58,7 @@ void BKE_object_defgroup_remove_all(struct Object *ob);
/* Select helpers */
enum eVGroupSelect;
//enum eVGroupSelect;
bool *BKE_object_defgroup_subset_from_select_type(
struct Object *ob, enum eVGroupSelect subset_type, int *r_defgroup_tot, int *r_subset_count);
void BKE_object_defgroup_subset_to_index_array(
@@ -30,6 +30,7 @@
/** \file BKE_property.h
* \ingroup bke
*/
#include "DNA_property_types.h"
struct bProperty;
struct ListBase;
@@ -33,6 +33,8 @@
* \author nzc
*/
#include "BLI_sys_types.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -32,11 +32,11 @@
* \since March 2001
* \author nzc
*/
#include "DNA_listBase.h"
struct ARegion;
struct Header;
struct ID;
struct ListBase;
struct Menu;
struct Panel;
struct Scene;
@@ -33,6 +33,8 @@
/* Shrinkwrap stuff */
#include "BKE_bvhutils.h"
// for SpaceTransform
#include "BLI_math_matrix.h"
/*
* Shrinkwrap is composed by a set of functions and options that define the type of shrink.
@@ -53,8 +55,6 @@ struct MDeformVert;
struct ShrinkwrapModifierData;
struct MDeformVert;
struct BVHTree;
struct SpaceTransform;
typedef struct ShrinkwrapCalcData {
ShrinkwrapModifierData *smd; //shrinkwrap modifier data
@@ -26,6 +26,8 @@
* \ingroup bke
*/
#include "DNA_listBase.h"
typedef enum SK_PType {
PT_CONTINUOUS,
PT_EXACT,
@@ -26,6 +26,7 @@
/** \file BKE_unit.h
* \ingroup bke
*/
#include "BLI_sys_types.h"
#ifdef __cplusplus
extern "C" {
@@ -23,7 +23,7 @@
#
# ***** END GPL LICENSE BLOCK *****
if (WITH_CPP_CORE)
if (WITH_CPP_DEV)
SET(CMAKE_C_COMPILER ${CMAKE_CXX_COMPILER})
endif()
@@ -543,4 +543,20 @@ if(WITH_LEGACY_DEPSGRAPH)
add_definitions(-DWITH_LEGACY_DEPSGRAPH)
endif()
if (WITH_CPP_CORE)
SET_SOURCE_FILES_PROPERTIES( ${SRC} PROPERTIES LANGUAGE CXX )
set_source_files_properties(
depsgraph_private.h
nla_private.h
tracking_private.h
intern/CCGSubSurf.h
intern/CCGSubSurf_inline.h
intern/CCGSubSurf_intern.h
intern/pbvh_intern.h
intern/data_transfer_intern.h
PROPERTIES HEADER_FILE_ONLY TRUE
)
endif()
blender_add_lib(bf_blenkernel "${SRC}" "${INC}" "${INC_SYS}")
@@ -25,6 +25,8 @@
* \ingroup bli
* \brief Efficient in-memory storage of multiple similar arrays.
*/
#include "BLI_sys_types.h"
typedef struct BArrayStore BArrayStore;
typedef struct BArrayState BArrayState;
@@ -24,6 +24,7 @@
/** \file BLI_array_store_utils.h
* \ingroup bli
*/
#include "BLI_sys_types.h"
struct BArrayStore;
@@ -27,6 +27,7 @@
*/
#include "BLI_compiler_typecheck.h"
#include "BLI_sys_types.h"
void _bli_array_reverse(void *arr, unsigned int arr_len, size_t arr_stride);
#define BLI_array_reverse(arr, arr_len) \
@@ -34,7 +34,7 @@
*/
#include "BLI_utildefines.h"
#include "DNA_listBase.h"
#include "BLI_bitmap.h"
/* -------------------------------------------------------------------- */
@@ -24,6 +24,7 @@
/** \file BLI_buffer.h
* \ingroup bli
*/
#include "BLI_sys_types.h"
typedef struct {
void *data;
@@ -28,7 +28,9 @@
* \author Daniel Dunbar
*/
#include "BLI_sys_types.h"
#include "BLI_compiler_attrs.h"
#include "BLI_compiler_compat.h"
struct EdgeHash;
typedef struct EdgeHash EdgeHash;
@@ -28,6 +28,7 @@
*/
#include "BLI_compiler_attrs.h"
#include "BLI_sys_types.h"
/* BLI_endian_switch_inline.h */
BLI_INLINE void BLI_endian_switch_int16(short *val) ATTR_NONNULL(1);
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <sys/stat.h>
#include "BLI_sys_types.h"
#ifdef __cplusplus
extern "C" {
@@ -34,6 +34,7 @@
#include "BLI_sys_types.h" /* for bool */
#include "BLI_compiler_attrs.h"
#include "BLI_compiler_compat.h"
#ifdef __cplusplus
extern "C" {
@@ -31,6 +31,7 @@
/** \file BLI_gsqueue.h
* \ingroup bli
*/
#include "BLI_sys_types.h"
typedef struct _GSQueue GSQueue;
@@ -25,6 +25,8 @@
* \ingroup bli
*/
#include "BLI_sys_types.h"
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
* result is always in little endian byte order, so that a byte-wise
* output yields to the wanted ASCII representation of the message
@@ -35,32 +35,32 @@ typedef void (*HeapFreeFP)(void *ptr);
/* Creates a new heap. BLI_memarena is used for allocating nodes. Removed nodes
* are recycled, so memory usage will not shrink. */
Heap *BLI_heap_new_ex(unsigned int tot_reserve) ATTR_WARN_UNUSED_RESULT;
Heap *BLI_heap_new(void) ATTR_WARN_UNUSED_RESULT;
void BLI_heap_clear(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1);
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1);
Heap *BLI_heap_new_ex(unsigned int tot_reserve);
Heap *BLI_heap_new(void);
void BLI_heap_clear(Heap *heap, HeapFreeFP ptrfreefp);
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp);
/* Insert heap node with a value (often a 'cost') and pointer into the heap,
* duplicate values are allowed. */
HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL(1);
HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr);
/* Remove a heap node. */
void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1, 2);
void BLI_heap_remove(Heap *heap, HeapNode *node);
/* Return 0 if the heap is empty, 1 otherwise. */
bool BLI_heap_is_empty(Heap *heap) ATTR_NONNULL(1);
bool BLI_heap_is_empty(Heap *heap);
/* Return the size of the heap. */
unsigned int BLI_heap_size(Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
unsigned int BLI_heap_size(Heap *heap);
/* Return the top node of the heap. This is the node with the lowest value. */
HeapNode *BLI_heap_top(Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
HeapNode *BLI_heap_top(Heap *heap);
/* Pop the top node off the heap and return it's pointer. */
void *BLI_heap_popmin(Heap *heap) ATTR_NONNULL(1);
void *BLI_heap_popmin(Heap *heap);
/* Return the value or pointer of a heap node. */
float BLI_heap_node_value(HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
void *BLI_heap_node_ptr(HeapNode *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
float BLI_heap_node_value(HeapNode *heap);
void *BLI_heap_node_ptr(HeapNode *heap);
#endif /* __BLI_HEAP_H__ */
Oops, something went wrong.

0 comments on commit 0906f49

Please sign in to comment.