Disable cycles when WITH_CYCLES=OFF
[blender.git] / source / blender / editors / interface / resources.c
index fd73ff8552a532e22948641d78c810be03b60813..54834fc75edc27d928b794baaeea75f89ccc1471 100644 (file)
@@ -2147,9 +2147,19 @@ void init_userdef_do_versions(void)
                        if (btheme->tipo.handle_sel_auto_clamped[3] == 0)
                                rgba_char_args_set(btheme->tipo.handle_sel_auto_clamped, 0xf0, 0xaf, 0x90, 255);
                }
-               
+
+#ifdef WITH_CYCLES
                /* enable (Cycles) addon by default */
                BKE_addon_ensure(&U.addons, "cycles");
+#else
+               {
+                       bAddon *addon = BLI_findstring(&U.addons, "cycles", offsetof(bAddon, module));
+                       if (addon) {
+                               BKE_addon_free(addon);
+                               BLI_remlink(&U.addons, addon);
+                       }
+               }
+#endif
        }
        
        if (!USER_VERSION_ATLEAST(260, 5)) {