support for compiling blender without python working again (with cmake at least)
authorCampbell Barton <ideasman42@gmail.com>
Sat, 23 Jan 2010 20:43:55 +0000 (20:43 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 23 Jan 2010 20:43:55 +0000 (20:43 +0000)
source/blender/blenkernel/intern/context.c
source/blender/makesrna/intern/CMakeLists.txt
source/blender/makesrna/intern/rna_wm.c
source/blender/windowmanager/intern/wm_files.c

index fc1ef4a..c715ce5 100644 (file)
@@ -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 */
 
index a9c3e35..38dd83c 100644 (file)
@@ -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)
index fd3ee81..9c52e2c 100644 (file)
@@ -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);
index f6e5263..776144a 100644 (file)
@@ -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");