Linux build can now produce a non-GPU .so

This commit is contained in:
Matthew Leibowitz 2017-02-13 04:57:03 +04:00
Родитель ade952a414
Коммит 33d03025e4
3 изменённых файлов: 21 добавлений и 11 удалений

Просмотреть файл

@ -426,6 +426,8 @@ Task ("externals-linux")
.WithCriteria (IsRunningOnLinux ())
.Does (() =>
{
var SUPPORT_GPU = "0"; // 1 == true, 0 == false
var ninja = DEPOT_PATH.CombineWithFilePath ("ninja").FullPath;
// set up the gyp environment variables
@ -442,14 +444,14 @@ Task ("externals-linux")
SetEnvironmentVariable ("SKIA_OUT", outPath);
// build skia_lib
RunGyp ("skia_os='linux' skia_arch_type='" + arch + "' skia_gpu=1 skia_pic=1 skia_pdf_use_sfntly=0 skia_freetype_static=1", "ninja");
RunGyp ("skia_os='linux' skia_arch_type='" + arch + "' skia_gpu=" + SUPPORT_GPU + " skia_pic=1 skia_pdf_use_sfntly=0 skia_freetype_static=1", "ninja");
RunProcess (ninja, new ProcessSettings {
Arguments = "-C out/" + folder + "/Release " + targets,
WorkingDirectory = SKIA_PATH.FullPath,
});
// build libSkiaSharp
RunProcess ("make", new ProcessSettings {
Arguments = "ARCH=" + folder + " VERSION=" + VERSION_FILE,
Arguments = "ARCH=" + folder + " VERSION=" + VERSION_FILE + " SUPPORT_GPU=" + SUPPORT_GPU,
WorkingDirectory = "native-builds/libSkiaSharp_linux",
});
});

2
externals/skia поставляемый

@ -1 +1 @@
Subproject commit 13849e529c7b3c116e077b479e83e67b8c5ab5a4
Subproject commit f28f1fa16be4401eb7cb5be233e685de348bdf9e

Просмотреть файл

@ -1,5 +1,6 @@
ARCH = x64
VERSION = 1.0.0.0
SUPPORT_GPU = 1
noop =
space = ${noop} ${noop}
@ -35,7 +36,6 @@ include_dirs = \
library_paths = \
../../externals/skia/out/${ARCH}/Release/libskia_core.a \
../../externals/skia/out/${ARCH}/Release/libskia_effects.a \
../../externals/skia/out/${ARCH}/Release/libskia_skgpu.a \
../../externals/skia/out/${ARCH}/Release/libskia_opts.a \
../../externals/skia/out/${ARCH}/Release/libskia_opts_sse41.a \
../../externals/skia/out/${ARCH}/Release/libskia_opts_sse42.a \
@ -45,7 +45,6 @@ library_paths = \
../../externals/skia/out/${ARCH}/Release/libskia_utils.a \
../../externals/skia/out/${ARCH}/Release/libskia_ports.a \
../../externals/skia/out/${ARCH}/Release/libskia_images.a \
../../externals/skia/out/${ARCH}/Release/libsksl.a \
../../externals/skia/out/${ARCH}/Release/libskia_pdf.a \
../../externals/skia/out/${ARCH}/Release/libskia_codec.a \
../../externals/skia/out/${ARCH}/Release/libskia_codec_android.a \
@ -69,11 +68,11 @@ library_paths = \
../../externals/skia/out/${ARCH}/Release/obj/gyp/libpiex.a \
../../externals/skia/out/${ARCH}/Release/obj/gyp/libexpat_static.a
defines = \
-DSK_INTERNAL -DSK_GAMMA_APPLY_TO_A8 -DQT_NO_KEYWORDS \
-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1 -DSK_SUPPORT_GPU=1 \
-DSK_FORCE_DISTANCE_FIELD_TEXT=0 -DSK_HAS_JPEG_LIBRARY \
-DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSKIA_C_DLL \
-DSKIA_IMPLEMENTATION=1 -DSK_CODEC_DECODES_RAW -DSK_SAMPLES_FOR_X \
-DSK_INTERNAL -DSK_GAMMA_APPLY_TO_A8 -DQT_NO_KEYWORDS \
-DSK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1 -DSK_SUPPORT_GPU=${SUPPORT_GPU} \
-DSK_FORCE_DISTANCE_FIELD_TEXT=0 -DSK_HAS_JPEG_LIBRARY \
-DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSKIA_C_DLL \
-DSKIA_IMPLEMENTATION=1 -DSK_CODEC_DECODES_RAW -DSK_SAMPLES_FOR_X \
-DSK_BUILD_FOR_UNIX -DNDEBUG
cflags = \
-msse2 -mfpmath=sse -g -fno-exceptions -fstrict-aliasing -Wall \
@ -87,11 +86,20 @@ else
endif
cflags_c =
cflags_cc = -std=c++11 -fno-rtti -fno-threadsafe-statics -Wnon-virtual-dtor
ldflags = $(library_dirs:%=-L%) -lpthread -ldl -lfontconfig -lGL -lGLU -lX11
ldflags = $(library_dirs:%=-L%) -lpthread -ldl -lfontconfig
includes = $(include_dirs:%=-I%)
library_names = $(notdir ${library_paths})
libraries = $(library_names:lib%.a=-l%)
# add the extras for GPU
ifeq "${SUPPORT_GPU}" "1"
library_paths += \
../../externals/skia/out/${ARCH}/Release/libskia_skgpu.a \
../../externals/skia/out/${ARCH}/Release/libsksl.a
ldflags += \
-lGL -lGLU -lX11
endif
src = $(shell find ${src_root} -name *.cpp -or -name *.c)
src_names = $(notdir ${src})
objs = $(src_names:%=${objarch_root}/%.o)