diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-23 23:43:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-23 23:43:55 +0300 |
commit | 22f7c8b1cd676d596fd23525f446938a0d022614 (patch) | |
tree | 50a94714f2cfe291d69cef73550c948e051b2a18 /source | |
parent | 9d96399eeb5de8aaff5af1852b0d4ff16e626df1 (diff) |
support for compiling blender without python working again (with cmake at least)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/context.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 8 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 3 |
4 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index fc1ef4aede9..c715ce5cf53 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -46,7 +46,9 @@ #include "BKE_screen.h" #include "BKE_global.h" +#ifndef DISABLE_PYTHON #include "BPY_extern.h" +#endif #include <string.h> @@ -413,13 +415,13 @@ static int ctx_data_get(bContext *C, const char *member, bContextDataResult *res int ret= 0; memset(result, 0, sizeof(bContextDataResult)); - +#ifndef DISABLE_PYTHON if(CTX_py_dict_get(C)) { return BPY_context_get(C, member, result); // if (BPY_context_get(C, member, result)) // return 1; } - +#endif /* we check recursion to ensure that we do not get infinite * loops requesting data from ourselfs in a context callback */ diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index a9c3e354667..38dd83c39d7 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -42,6 +42,12 @@ SET(SRC INCLUDE_DIRECTORIES(../../../../intern/guardedalloc .. ../../makesdna ../../blenkernel ../../blenlib ../../ikplugin ../../windowmanager ../../editors/include ../../imbuf ../../render/extern/include .) FILE(GLOB INC_FILES ../*.h ../../makesdna/*.h) +IF(WITH_PYTHON) + +ELSE(WITH_PYTHON) + ADD_DEFINITIONS(-DDISABLE_PYTHON) +ENDIF(WITH_PYTHON) + IF(WIN32) SET(INC ${INC} ${PTHREADS_INC}) ENDIF(WIN32) diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index fd3ee81334b..9c52e2cb9e9 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -698,6 +698,7 @@ static void operator_draw(bContext *C, wmOperator *op) RNA_parameter_list_free(&list); } +#ifndef DISABLE_PYTHON void operator_wrapper(wmOperatorType *ot, void *userdata); void macro_wrapper(wmOperatorType *ot, void *userdata); @@ -836,6 +837,7 @@ static StructRNA *rna_MacroOperator_register(const bContext *C, ReportList *repo return dummyot.ext.srna; } +#endif static StructRNA* rna_Operator_refine(PointerRNA *opr) { @@ -860,7 +862,9 @@ static void rna_def_operator(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Operator", "Storage of an operator being executed, or registered after execution."); RNA_def_struct_sdna(srna, "wmOperator"); RNA_def_struct_refine_func(srna, "rna_Operator_refine"); +#ifndef DISABLE_PYTHON RNA_def_struct_register_funcs(srna, "rna_Operator_register", "rna_Operator_unregister"); +#endif prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); @@ -918,8 +922,10 @@ static void rna_def_macro_operator(BlenderRNA *brna) RNA_def_struct_ui_text(srna, "Macro Operator", "Storage of a macro operator being executed, or registered after execution."); RNA_def_struct_sdna(srna, "wmOperator"); RNA_def_struct_refine_func(srna, "rna_MacroOperator_refine"); +#ifndef DISABLE_PYTHON RNA_def_struct_register_funcs(srna, "rna_MacroOperator_register", "rna_Operator_unregister"); - +#endif + prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_string_funcs(prop, "rna_Operator_name_get", "rna_Operator_name_length", NULL); diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index f6e5263e483..776144a7928 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -284,9 +284,10 @@ void WM_read_file(bContext *C, char *name, ReportList *reports) // refresh_interface_font(); CTX_wm_window_set(C, NULL); /* exits queues */ - +#ifndef DISABLE_PYTHON /* run any texts that were loaded in and flagged as modules */ BPY_load_user_modules(C); +#endif } else if(retval==1) BKE_write_undo(C, "Import file"); |