Disable cycles when WITH_CYCLES=OFF
authorCampbell Barton <ideasman42@gmail.com>
Mon, 12 Feb 2018 06:37:39 +0000 (17:37 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 12 Feb 2018 06:37:39 +0000 (17:37 +1100)
source/blender/editors/interface/CMakeLists.txt
source/blender/editors/interface/resources.c

index ede28b49dbee2a5e98caea70a287640b960f0cfe..0adc315fd692ce8fac972ac38020646d7beea65e 100644 (file)
@@ -82,6 +82,10 @@ if(WITH_HEADLESS)
        add_definitions(-DWITH_HEADLESS)
 endif()
 
+if(WITH_CYCLES)
+       add_definitions(-DWITH_CYCLES)
+endif()
+
 if(WITH_PYTHON)
        add_definitions(-DWITH_PYTHON)
 endif()
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)) {