Improve cairo and pixman (#806)
* Use meson to build cairo * Update xmake.lua * Update xmake.lua * modify ci * fix pixman and cario * Update xmake.lua * fix freetype pkgconfig * improve pkgconf * Update xmake.lua * restore ci Co-authored-by: Kelvin Zhang <zhangxp1998@gmail.com>pull/808/head
parent
b28784e30e
commit
4d6dedb0df
8 changed files with 91 additions and 292 deletions
@ -0,0 +1,39 @@ |
||||
diff --git a/meson.build b/meson.build
|
||||
index 3c261d0ff..5f98981e9 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -192,6 +192,9 @@ test_deps = []
|
||||
internal_deps = []
|
||||
extra_link_args = []
|
||||
|
||||
+thread_dep = dependency('threads')
|
||||
+deps += [thread_dep]
|
||||
+
|
||||
if host_machine.endian() == 'big'
|
||||
conf.set('WORDS_BIGENDIAN', 1)
|
||||
endif
|
||||
diff --git a/util/cairo-script/meson.build b/util/cairo-script/meson.build
|
||||
index 653c19d33..9f90bc8b5 100644
|
||||
--- a/util/cairo-script/meson.build
|
||||
+++ b/util/cairo-script/meson.build
|
||||
@@ -46,17 +46,20 @@ pkgmod.generate(libcairoscript,
|
||||
meson.override_dependency('cairo-script-interpreter', libcairoscript_dep)
|
||||
|
||||
csi_replay_exe = executable('csi-replay', csi_replay_sources,
|
||||
+ c_args: pthread_c_args,
|
||||
include_directories: [incbase],
|
||||
dependencies: deps + [libcairo_dep, libcairoscript_dep],
|
||||
)
|
||||
|
||||
csi_exec_exe = executable('csi-exec', csi_exec_sources,
|
||||
+ c_args: pthread_c_args,
|
||||
include_directories: [incbase],
|
||||
dependencies: deps + [libcairo_dep, libcairoscript_dep],
|
||||
)
|
||||
|
||||
if feature_conf.get('CAIRO_HAS_SCRIPT_SURFACE', 0) == 1 and conf.get('HAVE_LIBGEN_H', 0) == 1
|
||||
csi_trace_exe = executable('csi-trace', csi_trace_sources,
|
||||
+ c_args: pthread_c_args,
|
||||
include_directories: [incbase],
|
||||
dependencies: deps + [libcairo_dep, libcairoscript_dep],
|
||||
)
|
@ -1,27 +0,0 @@ |
||||
#ifndef CAIRO_FEATURES_H |
||||
#define CAIRO_FEATURES_H |
||||
|
||||
#ifdef _WIN32 |
||||
#define CAIRO_HAS_WIN32_SURFACE 1 |
||||
#define CAIRO_HAS_WIN32_FONT 1 |
||||
#endif |
||||
|
||||
#define CAIRO_HAS_PNG_FUNCTIONS 1 |
||||
#define CAIRO_HAS_PS_SURFACE 1 |
||||
#define CAIRO_HAS_PDF_SURFACE 1 |
||||
|
||||
#define CAIRO_HAS_SCRIPT_SURFACE 1 |
||||
#define CAIRO_HAS_SVG_SURFACE 1 |
||||
|
||||
#define CAIRO_HAS_IMAGE_SURFACE 1 |
||||
#define CAIRO_HAS_MIME_SURFACE 1 |
||||
#define CAIRO_HAS_RECORDING_SURFACE 1 |
||||
#define CAIRO_HAS_OBSERVER_SURFACE 1 |
||||
#define CAIRO_HAS_USER_FONT 1 |
||||
|
||||
#define CAIRO_HAS_GOBJECT_FUNCTIONS 0 |
||||
|
||||
#define CAIRO_HAS_FT_FONT 1 |
||||
#define CAIRO_HAS_FC_FONT ${FC_ON} |
||||
|
||||
#endif |
@ -1,230 +0,0 @@ |
||||
add_rules("mode.debug", "mode.release") |
||||
add_requires("zlib", "libpng", "pixman") |
||||
|
||||
option("with_x11") |
||||
set_default(is_plat("linux") and true or false) |
||||
add_defines("CAIRO_HAS_XLIB_SURFACE=1") |
||||
option_end() |
||||
if has_config("with_x11") then |
||||
add_requires("libxrender") |
||||
end |
||||
|
||||
option("with_freetype") |
||||
set_default(true) |
||||
add_defines( |
||||
"HAVE_FT_GLYPHSLOT_EMBOLDEN=1", |
||||
"HAVE_FT_LIBRARY_SETLCDFILTER=1", |
||||
"HAVE_FT_GLYPHSLOT_OBLIQUE=1", |
||||
"HAVE_FT_LOAD_SFNT_TABLE=1", |
||||
"HAVE_FT_GET_X11_FONT_FORMAT=" .. (has_config("with_x11") and "1" or "0"), |
||||
"CAIRO_HAS_FT_FONT=1" |
||||
) |
||||
option_end() |
||||
if has_config("with_freetype") then |
||||
add_requires("freetype") |
||||
end |
||||
|
||||
option("with_fontconfig") |
||||
set_default(is_plat("linux") and true or false) |
||||
add_defines( |
||||
"CAIRO_HAS_FC_FONT=1" |
||||
) |
||||
option_end() |
||||
if has_config("with_fontconfig") then |
||||
add_requires("fontconfig") |
||||
end |
||||
|
||||
target("cairo") |
||||
set_kind("$(kind)") |
||||
add_packages("zlib", "libpng", "pixman") |
||||
add_includedirs("$(projectdir)") |
||||
add_includedirs("$(projectdir)/src") |
||||
if is_plat("windows") then |
||||
if is_kind("static") then |
||||
add_defines("CAIRO_WIN32_STATIC_BUILD=1") |
||||
end |
||||
add_syslinks("gdi32", "msimg32", "user32") |
||||
elseif is_plat("macosx") then |
||||
add_frameworks("CoreGraphics", "CoreFoundation") |
||||
elseif is_plat("linux") then |
||||
add_cxflags("pthread") |
||||
end |
||||
|
||||
if is_plat("windows") then |
||||
add_includedirs("$(projectdir)/src/win32") |
||||
add_files( |
||||
"src/win32/cairo-win32-debug.c", |
||||
"src/win32/cairo-win32-device.c", |
||||
"src/win32/cairo-win32-gdi-compositor.c", |
||||
"src/win32/cairo-win32-system.c", |
||||
"src/win32/cairo-win32-surface.c", |
||||
"src/win32/cairo-win32-display-surface.c", |
||||
"src/win32/cairo-win32-printing-surface.c", |
||||
"src/win32/cairo-win32-font.c" |
||||
) |
||||
else |
||||
add_defines( |
||||
"HAVE_INTTYPES_H=1", |
||||
"HAVE_STDINT_H=1", |
||||
"HAVE_SYS_TYPES_H=1", |
||||
"HAVE_UINT64_T=1", |
||||
"HAVE_UNISTD_H=1", |
||||
"CAIRO_HAS_PTHREAD=1", |
||||
"CAIRO_HAS_REAL_PTHREAD=1" |
||||
) |
||||
end |
||||
|
||||
-- set_configvar("FT_ON", has_config("with_freetype") and 1 or 0) |
||||
-- add_configfiles("cairo-features.h.in", {prefixdir = "$(projectdir)"}) |
||||
add_headerfiles( |
||||
"src/cairo.h", |
||||
"src/cairo-deprecated.h", |
||||
"src/cairo-pdf.h", |
||||
"src/cairo-ps.h", |
||||
"src/cairo-script.h", |
||||
"src/cairo-svg.h", |
||||
"src/cairo-win32.h", |
||||
"src/cairo-ft.h", |
||||
"src/cairo-xlib.h", |
||||
"cairo-features.h", |
||||
"cairo-version.h", |
||||
"util/cairo-gobject/cairo-gobject.h", |
||||
{prefixdir = "cairo"} |
||||
) |
||||
add_files( |
||||
"src/cairo-analysis-surface.c", |
||||
"src/cairo-arc.c", |
||||
"src/cairo-array.c", |
||||
"src/cairo-atomic.c", |
||||
"src/cairo-base64-stream.c", |
||||
"src/cairo-base85-stream.c", |
||||
"src/cairo-bentley-ottmann.c", |
||||
"src/cairo-bentley-ottmann-rectangular.c", |
||||
"src/cairo-bentley-ottmann-rectilinear.c", |
||||
"src/cairo-botor-scan-converter.c", |
||||
"src/cairo-boxes.c", |
||||
"src/cairo-boxes-intersect.c", |
||||
"src/cairo.c", |
||||
"src/cairo-cache.c", |
||||
"src/cairo-clip.c", |
||||
"src/cairo-clip-boxes.c", |
||||
"src/cairo-clip-polygon.c", |
||||
"src/cairo-clip-region.c", |
||||
"src/cairo-clip-surface.c", |
||||
"src/cairo-color.c", |
||||
"src/cairo-composite-rectangles.c", |
||||
"src/cairo-compositor.c", |
||||
"src/cairo-contour.c", |
||||
"src/cairo-damage.c", |
||||
"src/cairo-debug.c", |
||||
"src/cairo-default-context.c", |
||||
"src/cairo-device.c", |
||||
"src/cairo-error.c", |
||||
"src/cairo-fallback-compositor.c", |
||||
"src/cairo-fixed.c", |
||||
"src/cairo-font-face.c", |
||||
"src/cairo-font-face-twin.c", |
||||
"src/cairo-font-face-twin-data.c", |
||||
"src/cairo-font-options.c", |
||||
"src/cairo-freelist.c", |
||||
"src/cairo-freed-pool.c", |
||||
"src/cairo-gstate.c", |
||||
"src/cairo-hash.c", |
||||
"src/cairo-hull.c", |
||||
"src/cairo-image-compositor.c", |
||||
"src/cairo-image-info.c", |
||||
"src/cairo-image-source.c", |
||||
"src/cairo-image-surface.c", |
||||
"src/cairo-line.c", |
||||
"src/cairo-lzw.c", |
||||
"src/cairo-matrix.c", |
||||
"src/cairo-mask-compositor.c", |
||||
"src/cairo-mesh-pattern-rasterizer.c", |
||||
"src/cairo-mempool.c", |
||||
"src/cairo-misc.c", |
||||
"src/cairo-mono-scan-converter.c", |
||||
"src/cairo-mutex.c", |
||||
"src/cairo-no-compositor.c", |
||||
"src/cairo-observer.c", |
||||
"src/cairo-output-stream.c", |
||||
"src/cairo-paginated-surface.c", |
||||
"src/cairo-path-bounds.c", |
||||
"src/cairo-path.c", |
||||
"src/cairo-path-fill.c", |
||||
"src/cairo-path-fixed.c", |
||||
"src/cairo-path-in-fill.c", |
||||
"src/cairo-path-stroke.c", |
||||
"src/cairo-path-stroke-boxes.c", |
||||
"src/cairo-path-stroke-polygon.c", |
||||
"src/cairo-path-stroke-traps.c", |
||||
"src/cairo-path-stroke-tristrip.c", |
||||
"src/cairo-pattern.c", |
||||
"src/cairo-pen.c", |
||||
"src/cairo-polygon.c", |
||||
"src/cairo-polygon-intersect.c", |
||||
"src/cairo-polygon-reduce.c", |
||||
"src/cairo-raster-source-pattern.c", |
||||
"src/cairo-recording-surface.c", |
||||
"src/cairo-rectangle.c", |
||||
"src/cairo-rectangular-scan-converter.c", |
||||
"src/cairo-region.c", |
||||
"src/cairo-rtree.c", |
||||
"src/cairo-scaled-font.c", |
||||
"src/cairo-shape-mask-compositor.c", |
||||
"src/cairo-slope.c", |
||||
"src/cairo-spans.c", |
||||
"src/cairo-spans-compositor.c", |
||||
"src/cairo-spline.c", |
||||
"src/cairo-stroke-dash.c", |
||||
"src/cairo-stroke-style.c", |
||||
"src/cairo-surface.c", |
||||
"src/cairo-surface-clipper.c", |
||||
"src/cairo-surface-fallback.c", |
||||
"src/cairo-surface-observer.c", |
||||
"src/cairo-surface-offset.c", |
||||
"src/cairo-surface-snapshot.c", |
||||
"src/cairo-surface-subsurface.c", |
||||
"src/cairo-surface-wrapper.c", |
||||
"src/cairo-time.c", |
||||
"src/cairo-tor-scan-converter.c", |
||||
"src/cairo-tor22-scan-converter.c", |
||||
"src/cairo-clip-tor-scan-converter.c", |
||||
"src/cairo-tag-attributes.c", |
||||
"src/cairo-tag-stack.c", |
||||
"src/cairo-toy-font-face.c", |
||||
"src/cairo-traps.c", |
||||
"src/cairo-tristrip.c", |
||||
"src/cairo-traps-compositor.c", |
||||
"src/cairo-unicode.c", |
||||
"src/cairo-user-font.c", |
||||
"src/cairo-version.c", |
||||
"src/cairo-wideint.c", |
||||
-- generic font support |
||||
"src/cairo-cff-subset.c", |
||||
"src/cairo-scaled-font-subsets.c", |
||||
"src/cairo-truetype-subset.c", |
||||
"src/cairo-type1-fallback.c", |
||||
"src/cairo-type1-glyph-names.c", |
||||
"src/cairo-type1-subset.c", |
||||
"src/cairo-type3-glyph-surface.c", |
||||
-- pdf |
||||
"src/cairo-pdf-interchange.c", |
||||
"src/cairo-pdf-operators.c", |
||||
"src/cairo-pdf-shading.c", |
||||
"src/cairo-pdf-surface.c", |
||||
-- png |
||||
"src/cairo-png.c", |
||||
-- ps surface |
||||
"src/cairo-ps-surface.c", |
||||
-- deflate source |
||||
"src/cairo-deflate-stream.c", |
||||
-- svg surface |
||||
"src/cairo-svg-surface.c", |
||||
-- script surface |
||||
"src/cairo-script-surface.c" |
||||
) |
||||
if has_config("with_freetype") then |
||||
add_files("src/cairo-ft-font.c") |
||||
add_packages("freetype", "fontconfig") |
||||
end |
||||
target_end() |
Loading…
Reference in new issue