diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-02-12 09:37:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-02-12 09:37:39 +0300 |
commit | 53431a560e51d106e78de00f7faef5bfccc8e933 (patch) | |
tree | 2049dd0a14c5097b22caaa09df7cb342e2d0932a /source/blender/editors | |
parent | fc97e120f69f4cf3f46d9c949897430a8ecb3bec (diff) |
Disable cycles when WITH_CYCLES=OFF
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/resources.c | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index ede28b49dbe..0adc315fd69 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -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() diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index fd73ff8552a..54834fc75ed 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -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)) { |