diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-05 11:55:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-05 11:55:18 +0400 |
commit | b727202921f537b50ab5ebdf7367da1c4416120d (patch) | |
tree | 954ed4385ac89f5b4e281ef3b8f1a1ad53cc8227 /source/blender/editors | |
parent | 3a6adc0ed30be1d940f8069ad5e35bb27140ada6 (diff) |
compile without splash and icons when WITH_HEADLESS is set.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/datafiles/CMakeLists.txt | 71 | ||||
-rw-r--r-- | source/blender/editors/interface/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 9 | ||||
-rw-r--r-- | source/blender/editors/space_file/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 4 |
6 files changed, 63 insertions, 33 deletions
diff --git a/source/blender/editors/datafiles/CMakeLists.txt b/source/blender/editors/datafiles/CMakeLists.txt index 8761297b979..ae86905a91d 100644 --- a/source/blender/editors/datafiles/CMakeLists.txt +++ b/source/blender/editors/datafiles/CMakeLists.txt @@ -29,41 +29,48 @@ set(INC_SYS set(SRC Bfont.c - add.png.c bfont.ttf.c - blenderbuttons.c - blob.png.c - blur.png.c bmonofont.ttf.c - clay.png.c - clone.png.c - crease.png.c - darken.png.c - draw.png.c - fill.png.c - flatten.png.c - grab.png.c - inflate.png.c - layer.png.c - lighten.png.c - mix.png.c - multiply.png.c - nudge.png.c - pinch.png.c - preview.blend.c - prvicons.c - scrape.png.c - smear.png.c - smooth.png.c - snake_hook.png.c - soften.png.c - splash.png.c startup.blend.c - subtract.png.c - texdraw.png.c - thumb.png.c - twist.png.c - vertexdraw.png.c + preview.blend.c ) +if(NOT WITH_HEADLESS) + list(APPEND SRC + splash.png.c + blenderbuttons.c + + # brushes + add.png.c + blob.png.c + blur.png.c + clay.png.c + clone.png.c + crease.png.c + darken.png.c + draw.png.c + fill.png.c + flatten.png.c + grab.png.c + inflate.png.c + layer.png.c + lighten.png.c + mix.png.c + multiply.png.c + nudge.png.c + pinch.png.c + prvicons.c + scrape.png.c + smear.png.c + smooth.png.c + snake_hook.png.c + soften.png.c + subtract.png.c + texdraw.png.c + thumb.png.c + twist.png.c + vertexdraw.png.c + ) +endif() + blender_add_lib(bf_editor_datafiles "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index 9902cac8857..6dd7af70e33 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -63,6 +63,10 @@ if(WITH_INTERNATIONAL) add_definitions(-DINTERNATIONAL) endif() +if(WITH_HEADLESS) + add_definitions(-DWITH_HEADLESS) +endif() + if(WITH_PYTHON) add_definitions(-DWITH_PYTHON) endif() diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index f9c97c36bdd..710d4d58825 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -471,6 +471,9 @@ void uiEmboss(float x1, float y1, float x2, float y2, int sel) void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors *UNUSED(wcol), rcti *rect) { +#ifdef WITH_HEADLESS + (void)rect; +#else extern char datatoc_splash_png[]; extern int datatoc_splash_png_size; ImBuf *ibuf; @@ -507,6 +510,7 @@ void ui_draw_but_IMAGE(ARegion *UNUSED(ar), uiBut *UNUSED(but), uiWidgetColors * */ IMB_freeImBuf(ibuf); +#endif } #if 0 diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index b92097d124b..3bf2a9ddd02 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -461,6 +461,7 @@ static void vicon_move_down_draw(int x, int y, int w, int h, float UNUSED(alpha) glDisable(GL_LINE_SMOOTH); } +#ifndef WITH_HEADLESS static void init_brush_icons(void) { @@ -588,7 +589,7 @@ static void init_internal_icons(void) IMB_freeImBuf(bbuf); } - +#endif // WITH_HEADLESS static void init_iconfile_list(struct ListBase *list) { @@ -704,6 +705,7 @@ ListBase *UI_iconfile_list(void) void UI_icons_free(void) { +#ifndef WITH_HEADLESS if(icongltex.id) { glDeleteTextures(1, &icongltex.id); icongltex.id= 0; @@ -711,6 +713,7 @@ void UI_icons_free(void) free_iconfile_list(&iconfilelist); BKE_icons_free(); +#endif } void UI_icons_free_drawinfo(void *drawinfo) @@ -792,10 +795,14 @@ int UI_icon_get_height(int icon_id) void UI_icons_init(int first_dyn_id) { +#ifdef WITH_HEADLESS + (void)first_dyn_id; +#else init_iconfile_list(&iconfilelist); BKE_icons_init(first_dyn_id); init_internal_icons(); init_brush_icons(); +#endif } /* Render size for preview images and icons diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt index e161e2d4b9b..afa746ea359 100644 --- a/source/blender/editors/space_file/CMakeLists.txt +++ b/source/blender/editors/space_file/CMakeLists.txt @@ -51,6 +51,10 @@ set(SRC fsmenu.h ) +if(WITH_HEADLESS) + add_definitions(-DWITH_HEADLESS) +endif() + if(WITH_IMAGE_OPENEXR) add_definitions(-DWITH_OPENEXR) endif() diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 9b65589ef4c..32b725e0b1f 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -373,7 +373,11 @@ void filelist_init_icons(void) short x, y, k; ImBuf *bbuf; ImBuf *ibuf; +#ifdef WITH_HEADLESS + bbuf = NULL; +#else bbuf = IMB_ibImageFromMemory((unsigned char*)datatoc_prvicons, datatoc_prvicons_size, IB_rect); +#endif if (bbuf) { for (y=0; y<SPECIAL_IMG_ROWS; y++) { for (x=0; x<SPECIAL_IMG_COLS; x++) { |