CMake: support building without Python
authorCampbell Barton <ideasman42@gmail.com>
Mon, 25 Nov 2019 04:45:03 +0000 (15:45 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 25 Nov 2019 04:45:49 +0000 (15:45 +1100)
Resolve linking issues, warnings.

source/blender/blenkernel/CMakeLists.txt
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_region_tooltip.c
source/blender/editors/mesh/CMakeLists.txt
source/blender/editors/object/CMakeLists.txt
source/blender/editors/space_api/CMakeLists.txt
source/blender/editors/util/numinput.c
source/blender/makesrna/intern/CMakeLists.txt
source/creator/CMakeLists.txt

index 3bbb133c72ff47e853c4361fdc40e25a5ca62471..883518b7a9d5e96108e9e104e5a4742556a09b3a 100644 (file)
@@ -396,8 +396,6 @@ set(LIB
   bf_modifiers
   bf_nodes
   bf_physics
-  bf_python
-  bf_python_bmesh
   bf_rna
   bf_shader_fx
 )
@@ -503,6 +501,10 @@ if(WITH_PYTHON)
   list(APPEND INC
     ../python
   )
+  list(APPEND LIB
+    bf_python
+    bf_python_bmesh
+  )
   add_definitions(-DWITH_PYTHON)
 
   if(WITH_PYTHON_SAFETY)
index ff6b65ffbfc24d563167715543476028eccc97bf..8af8fdb06a12f45a8fd34127916864b16245815c 100644 (file)
@@ -2777,6 +2777,7 @@ static bool ui_number_from_string(bContext *C, const char *str, double *r_value)
 #ifdef WITH_PYTHON
   return BPY_execute_string_as_number(C, NULL, str, true, r_value);
 #else
+  UNUSED_VARS(C);
   *r_value = atof(str);
   return true;
 #endif
index 3f20e8247b9c23663324eb135f898ad9a165507a..8cea80bac7f0b66d1504d9bc65795b71c1d9513e 100644 (file)
@@ -295,6 +295,8 @@ static void ui_tooltip_region_free_cb(ARegion *ar)
 /** \name ToolTip Creation
  * \{ */
 
+#ifdef WITH_PYTHON
+
 static bool ui_tooltip_data_append_from_keymap(bContext *C, uiTooltipData *data, wmKeyMap *keymap)
 {
   const int fields_len_init = data->fields_len;
@@ -345,6 +347,8 @@ static bool ui_tooltip_data_append_from_keymap(bContext *C, uiTooltipData *data,
   return (fields_len_init != data->fields_len);
 }
 
+#endif /* WITH_PYTHON */
+
 /**
  * Special tool-system exception.
  */
@@ -607,6 +611,8 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but, bool is
       BLI_assert(0);
     }
   }
+#else
+  UNUSED_VARS(is_label);
 #endif /* WITH_PYTHON */
 
   if (data->fields_len == 0) {
index 88da40b947f2da244d6eff72fddd24b241c89829..e41445aef09def3466cec270b65a1f5c76dbe811 100644 (file)
@@ -78,6 +78,7 @@ set(SRC
 set(LIB
   bf_blenkernel
   bf_blenlib
+  bf_windowmanager
 )
 
 if(WITH_INTERNATIONAL)
index aabfa78cf582d17f3757ab999cb91a6a5304f2f1..69abe475fed25535e4408e0b56716622cf41fe13 100644 (file)
@@ -73,7 +73,9 @@ set(SRC
 set(LIB
   bf_blenkernel
   bf_blenlib
+  bf_editor_mesh
   bf_render
+  bf_windowmanager
 )
 
 add_definitions(${GL_DEFINITIONS})
index 74d9b703c68ded746a113edfe50c46e0a8d3a333..de1c905b08b474d6b761c60d7d6d3f2ecfecae59 100644 (file)
@@ -35,8 +35,6 @@ set(SRC
 )
 
 set(LIB
-  bf_editor_io
-  bf_editor_sound
   bf_editor_space_action
   bf_editor_space_buttons
   bf_editor_space_clip
index aca695be2452c87c3fc253e804a1ecc56e2ab7b5..ead841642d7bd1afc90d79401dee64c878fee0b3 100644 (file)
@@ -298,6 +298,7 @@ bool user_string_to_number(
     return success;
   }
 #else
+  UNUSED_VARS(C, unit, type);
   *r_value = atof(str);
   return true;
 #endif
index 42569ec5fa12097ab1855be38b511599a3ee353f..f3ade54d5eca0830fcc42ea41a11933779d70e01 100644 (file)
@@ -386,23 +386,23 @@ set(SRC
 
 set(LIB
   bf_dna
+  bf_editor_space_api
+
+  bf_editor_animation
   bf_editor_armature
   bf_editor_curve
   bf_editor_gizmo_library
   bf_editor_gpencil
+  bf_editor_io
   bf_editor_mesh
   bf_editor_object
   bf_editor_physics
   bf_editor_render
   bf_editor_scene
   bf_editor_sculpt_paint
-  bf_editor_space_clip
-  bf_editor_space_file
-  bf_editor_space_image
-  bf_editor_space_info
-  bf_editor_space_node
-  bf_editor_space_view3d
+  bf_editor_sound
   bf_editor_transform
+  bf_editor_undo
 )
 
 add_definitions(${GL_DEFINITIONS})
index 6e2d9acec32eada8b9bcb1ba5c55f3edb20ae69d..53e84de7652e527880683426aed98f7fd6afb9d1 100644 (file)
@@ -38,18 +38,15 @@ blender_include_dirs(
 )
 
 set(LIB
-  bf_blenloader
   bf_blenkernel
-  bf_blenlib
+  bf_blenloader
   bf_depsgraph
   bf_dna
-  bf_editor_datafiles
   bf_imbuf
   bf_intern_clog
   bf_intern_guardedalloc
   bf_intern_memutil
   bf_intern_opencolorio
-  bf_python
   bf_render
   bf_rna
   bf_windowmanager
@@ -89,6 +86,9 @@ endif()
 
 if(WITH_PYTHON)
   blender_include_dirs(../blender/python)
+  list(APPEND LIB
+    bf_python
+  )
   add_definitions(-DWITH_PYTHON)
 
   if(WITH_PYTHON_SECURITY)