From bb0708a483f5058f228b2b15f4801467ebddde9d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Nov 2019 15:45:03 +1100 Subject: CMake: support building without Python Resolve linking issues, warnings. --- source/blender/blenkernel/CMakeLists.txt | 6 ++++-- source/blender/editors/interface/interface.c | 1 + source/blender/editors/interface/interface_region_tooltip.c | 6 ++++++ source/blender/editors/mesh/CMakeLists.txt | 1 + source/blender/editors/object/CMakeLists.txt | 2 ++ source/blender/editors/space_api/CMakeLists.txt | 2 -- source/blender/editors/util/numinput.c | 1 + source/blender/makesrna/intern/CMakeLists.txt | 12 ++++++------ 8 files changed, 21 insertions(+), 10 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 3bbb133c72f..883518b7a9d 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -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) diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index ff6b65ffbfc..8af8fdb06a1 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -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 diff --git a/source/blender/editors/interface/interface_region_tooltip.c b/source/blender/editors/interface/interface_region_tooltip.c index 3f20e8247b9..8cea80bac7f 100644 --- a/source/blender/editors/interface/interface_region_tooltip.c +++ b/source/blender/editors/interface/interface_region_tooltip.c @@ -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) { diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt index 88da40b947f..e41445aef09 100644 --- a/source/blender/editors/mesh/CMakeLists.txt +++ b/source/blender/editors/mesh/CMakeLists.txt @@ -78,6 +78,7 @@ set(SRC set(LIB bf_blenkernel bf_blenlib + bf_windowmanager ) if(WITH_INTERNATIONAL) diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index aabfa78cf58..69abe475fed 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -73,7 +73,9 @@ set(SRC set(LIB bf_blenkernel bf_blenlib + bf_editor_mesh bf_render + bf_windowmanager ) add_definitions(${GL_DEFINITIONS}) diff --git a/source/blender/editors/space_api/CMakeLists.txt b/source/blender/editors/space_api/CMakeLists.txt index 74d9b703c68..de1c905b08b 100644 --- a/source/blender/editors/space_api/CMakeLists.txt +++ b/source/blender/editors/space_api/CMakeLists.txt @@ -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 diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index aca695be245..ead841642d7 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -298,6 +298,7 @@ bool user_string_to_number( return success; } #else + UNUSED_VARS(C, unit, type); *r_value = atof(str); return true; #endif diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 42569ec5fa1..f3ade54d5ec 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -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}) -- cgit v1.2.3