CMake: support building without Python

Resolve linking issues, warnings.
This commit is contained in:
Campbell Barton
2019-11-25 15:45:03 +11:00
parent b2d940250c
commit bb0708a483
9 changed files with 25 additions and 14 deletions

View 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)

View 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

View 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) {

View File

@@ -78,6 +78,7 @@ set(SRC
set(LIB
bf_blenkernel
bf_blenlib
bf_windowmanager
)
if(WITH_INTERNATIONAL)

View File

@@ -73,7 +73,9 @@ set(SRC
set(LIB
bf_blenkernel
bf_blenlib
bf_editor_mesh
bf_render
bf_windowmanager
)
add_definitions(${GL_DEFINITIONS})

View 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

View 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

View 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})

View 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)