Skip to content

Commit

Permalink
feature: option to build tcvm without skia
Browse files Browse the repository at this point in the history
This feature ables to build TCVM without Skia. By default, this option is ON.
Without Skia, is possible to generate a very little final libtcvm
(~3MB on Linux).
It's also now possible to test the VM on OpenBSD.
Usage - Disable Skia: cmake <source_dir> -DUSE_SKIA=OFF
  • Loading branch information
erathke committed Jan 30, 2021
1 parent b1374e6 commit 2f1c900
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions TotalCrossVM/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ ENDIF (NOT (DEFINED ANDROID_ABI OR MSVC OR CMAKE_GENERATOR STREQUAL Xcode))
if(NOT MSVC AND USE_SKIA)
find_package(Skia REQUIRED)
include_directories(${SKIA_INCLUDE_DIRS})
add_compile_definitions(USE_SKIA)
endif(NOT MSVC AND USE_SKIA)

set(TC_SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
Expand Down
2 changes: 1 addition & 1 deletion TotalCrossVM/src/nm/ui/GraphicsPrimitives.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#include "tcclass.h"

#if defined SKIA_H && (defined ANDROID || defined darwin || defined HEADLESS)
#if defined USE_SKIA && (defined ANDROID || defined darwin || defined HEADLESS)
#include "android/skia.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion TotalCrossVM/src/nm/ui/PalmFont_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ UserFont loadUserFontFromFontObj(Context currentContext, TCObject fontObj, JChar
}
}

#if defined SKIA_H && (defined ANDROID || defined darwin || defined HEADLESS)
#if defined USE_SKIA && (defined ANDROID || defined darwin || defined HEADLESS)
#include "android/skia.h"

int32 getJCharWidth(Context currentContext, TCObject fontObj, JChar ch) {
Expand Down
2 changes: 1 addition & 1 deletion TotalCrossVM/src/nm/ui/font_Font.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "tcvm.h"
#include "PalmFont_c.h"
#if defined SKIA_H && (defined ANDROID || defined darwin || defined HEADLESS)
#if defined USE_SKIA && (defined ANDROID || defined darwin || defined HEADLESS)
#include "android/skia.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion TotalCrossVM/src/nm/ui/gfx_Graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// SPDX-License-Identifier: LGPL-2.1-only

#include "tcvm.h"
#if defined SKIA_H && (defined ANDROID || defined darwin || defined HEADLESS)
#if defined USE_SKIA && (defined ANDROID || defined darwin || defined HEADLESS)
#define Graphics_forePixel(o) (Graphics_foreColor(o) | 0xFF000000)
#define Graphics_backPixel(o) (Graphics_backColor(o) | 0xFF000000)
#else
Expand Down
2 changes: 1 addition & 1 deletion TotalCrossVM/src/nm/ui/image_Image.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ TC_API void tuiI_setTransparentColor_i(NMParams p) // totalcross/ui/image/Image
p->retO = thisObj;
}

#if defined SKIA_H && (defined ANDROID || defined darwin || defined HEADLESS)
#if defined USE_SKIA && (defined ANDROID || defined darwin || defined HEADLESS)
#include "android/skia.h"
#endif
//////////////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion TotalCrossVM/src/nm/ui/linux/gfx_Graphics_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void privateScreenChange(int32 w, int32 h)
}

#include "../../init/tcsdl.h"
#ifdef SKIA_H
#ifdef USE_SKIA
#include "../android/skia.h"
#endif

Expand Down

0 comments on commit 2f1c900

Please sign in to comment.