Commit graph

105 commits

Author SHA1 Message Date
Benjamin Gilbert
7a780896a1 win32: Fix MSVC build with dwrite disabled
We now require at least Windows Vista.  When dwrite is disabled, declare
WINVER accordingly so we get the defines we no longer carry ourselves.
The default dwrite-enabled path already has a new-enough WINVER.

Fixes: d0ee67a142 ("Win32: Remove unused code and defines for old toolchains")
2025-07-14 12:17:27 -07:00
Luca Bacci
51be2591fe Meson: Define _CRT_SECURE_NO_WARNINGS when compiling with MSVC 2025-06-16 19:10:07 +02:00
Luca Bacci
481c6c78bd Meson: Suppress warning C5286 on MSVC
This happens when converting _cairo_status to _cairo_int_status:

  warning C5286: implicit conversion from enum type '_cairo_int_status' to
  enum type '_cairo_status'; use an explicit cast to silence this warning
2025-06-16 19:01:58 +02:00
Luca Bacci
cc51930a32 Meson: Add arguments for both C and C++ compilation
C++ compilation is used on Windows
2025-06-16 18:58:00 +02:00
Luca Bacci
ec2e879e0d Meson: Add comment about atomic ops on Windows 2025-06-16 18:49:36 +02:00
Emmanuele Bassi
3bfe1eed02 Merge branch 'meson' into 'master'
Minor Meson cleanups

See merge request cairo/cairo!584
2025-01-30 09:31:59 +00:00
Luca Bacci
dfd06ab388 Meson: Require C++11 2025-01-16 16:49:05 +01:00
Alan Coopersmith
78f7dbcba8 Fix cairo-perf-print build on Solaris
Adds include of <termios.h> if system has it, in order to fix:

../perf/cairo-perf-print.c: In function ‘report_print’:
../perf/cairo-perf-print.c:62:28: error: storage size of ‘ws’ isn’t known
   62 |             struct winsize ws;
      |                            ^~
../perf/cairo-perf-print.c:64:26: error: ‘TIOCGWINSZ’ undeclared
 (first use in this function)
   64 |             if(ioctl(fd, TIOCGWINSZ, &ws) == 0 ) {
      |                          ^~~~~~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-10-13 11:07:44 -07:00
Håvard Graff
c1748e79f0 meson: expose lzo as a meson option 2024-09-10 16:26:21 +02:00
Benjamin Gilbert
af4f149057 meson: Don't require C++ compiler for build machine on Windows
We only build C++ code for the host.  Fixes Meson warning:

    meson.build:486: WARNING: add_languages is missing native:, assuming languages are wanted for both host and build.
2024-09-04 21:51:25 -07:00
Adrian Johnson
1d20d8f476 meson: use has_define() to check if define exists 2024-07-25 08:27:37 +09:30
Adrian Johnson
b69d569c3c Windows should always use win32 atomics
instead of gcc builtins.
2024-07-25 08:25:57 +09:30
Thomas Devoogdt
5dc457fa92 meson: only require cpp for windows
Allow to compile meson without c++ toolchain.

Fixes:
 - https://lore.kernel.org/buildroot/20240717200926.1a7db2a1@windsurf/

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
2024-07-18 10:29:19 +00:00
Adrian Johnson
f0a651e1ac Merge branch 'c11-atomics' into 'master'
Add support for C11 atomics

See merge request cairo/cairo!479
2024-05-31 09:40:37 +00:00
Uli Schlachter
01a8ca0518 Merge branch 'master' into 'master'
Update to add sunos

See merge request cairo/cairo!526
2024-05-28 16:30:57 +00:00
Adrian Johnson
87f7c60bf7 Add support for C11 atomics 2024-05-26 21:17:39 +09:30
Adrian Johnson
b3656ed596 Update required libpng version 2024-05-25 10:25:51 +09:30
Adrian Johnson
bc4dfe51d2 Update required fontconfig version 2024-05-25 10:19:30 +09:30
Adrian Johnson
94e3c5ce81 Update minimum FreeType to 2.10
and remove feature guards for FT functions that are in 2.10 or later.
2024-05-25 09:02:53 +09:30
Adrian Johnson
60fea22d5d Update meson wraps 2024-05-23 09:10:38 +09:30
Adrian Johnson
b60f47dfd5 Require C11 2024-05-22 08:20:18 +09:30
Adrian Johnson
3d46485365 Only use PIXMAN_r8g8b8_sRGB if available
Pixman 0.42.3 added PIXMAN_r8g8b8_sRGB to pixman_format_code_t. CI
fails if it is missing from switch statements. Building with pixman <
0.42.3 will fail if the enum is used. So put it in a versioned #if.
2024-05-21 19:47:55 +09:30
Alan Coopersmith
44e4e11236 Fix alloca undefined on Solaris
Solaris defines alloca in the <alloca.h> header

../src/cairo-colr-glyph-render.c: In function ‘add_sweep_gradient_patches’:
../src/cairo-colr-glyph-render.c:661:14: error: implicit declaration of
 function ‘alloca’ [-Werror=implicit-function-declaration]
  661 |     angles = alloca (sizeof (double) * cl->n_stops);
      |              ^~~~~~

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-04-15 10:40:08 -07:00
Uli Schlachter
95ee2708b8 Merge branch 'bugfix/cross-compile' into 'master'
meson: always skip IPC_RMID_DEFERRED_RELEASE check when cross compiling

See merge request cairo/cairo!534
2024-04-05 14:05:14 +00:00
Marek Kasik
1bd4d59705 Prefer COLRv1 table 2024-03-21 20:55:15 +00:00
Thomas Devoogdt
8d5037ed64
meson: always skip IPC_RMID_DEFERRED_RELEASE check when cross-compiling
../../br-test-pkg/bootlin-armv5-uclibc/build/cairo-1.17.4/meson.build:279:13:
ERROR: Can not run test applications in this cross environment.

Commit 1bec56ea8a added support to define
ipc_rmid_deferred_release in a cross-compile config, but still kept
the default to auto, which anyhow results in an error when cross-compiling.

There is only one usage of the ipc_rmid_deferred_release compile declarative
which was originally added in this commit: 5041b462d0.

If ipc_rmid_deferred_release is set to FALSE, an additional XSync is performed.
This doesn't sound very harmful, so that is why this commit defaults to FALSE
and thus avoids any cross-compile errors.

Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2024-02-06 14:56:45 +01:00
Niveditha Rau
54231e89f3 Update file meson.build 2023-11-07 23:21:57 +00:00
Adrian Johnson
b23f4b3fc2 Require pixman >= 0.40 2023-10-02 15:56:04 +10:30
Emmanuele Bassi
77c2820840 Drop "slim" symbols
The original "slim" symbol rewriting was added without any shred of a
set of performance evaluation, and mostly copy-pasted from a very early
version of pixman. Pixman itself never used them, and most C
libraries—like GLib and GTK—have dropped similar mechanisms over the
past 15 years, as linkers have improved considerably in the meantime.

Modern linkers provide functionality to avoid intra-library PLT jump
through flags like `-Bsymbolic-functions`; we should use that, instead,
and keep the code base more maintainable and debuggable.
2023-08-16 16:33:04 +01:00
Emmanuele Bassi
c68766370d build: Drop legacy build
It's been a while since we dropped the Autotools build; it's time to let
go of the past.
2023-08-13 16:45:24 +01:00
Sergey Bugaev
bcb7937545 Consistently spell "FreeType" with capital T
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-07-17 15:35:40 +03:00
Sergey Bugaev
a3a7ca452f meson: Don't pull in FreeType and Fontconfig by default
Commit f6a3f6d8ad
"Don't build fontconfig on Windows" made an attempt to prevent Meson
from automatically building Fontconfig as a subproject on Windows when
the 'fontconfig' option has its default value of 'auto'.

Unfortunately, this only made things worse instead of fixing them.

Meson feature options can have three states: 'enabled', 'auto', and
'disabled'. They are primarily intended to be used as a value for the
'required' option of the 'dependency()' function. When the system
dependency is not found, but a fallback subproject is provided
explicitly with the 'fallback' option, a feature option in the 'auto'
state still causes the subproject to get built.

Since there's no apparent way to produce a value of the "feature option
object" type in a specific state, commit f6a3f6d8ad instead
set fontconfig_option = false (when it wasn't set to 'enabled', i.e. it
was either 'auto' or 'disabled') in an attempt to disable building the
subproject. However, a boolean value of false is equivalent to 'auto',
not to 'disabled'. This is documented at
https://mesonbuild.com/Build-options.html#features

So commit f6a3f6d8ad wanted to convert
'auto' to 'disabled', but instead effectively converted 'disabled' to
'auto', causing the Fontconfig subproject to be always built on Windows,
even when explicitly turned off with -D fontconfig=disabled.

A way to accomplish the original goal is available since Meson 0.59;
feature option objects gained the '.disable_auto_if()' method that
exactly converts 'auto' to 'disabled' if the boolean condition is true.
So make use of this method to properly turn off building Fontconfig on
Windows, unless explicitly enabled with -D fontconfig=enabled.

Apply the same for FreeType, which is also not very useful on Windows.

See also: 7f8135bfeb

Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>
2023-07-17 15:34:44 +03:00
Uli Schlachter
5ef0375a7d Disable svg glyph renderer when PNG is disabled
When trying to build with -Dpng=disabled with a new enough FreeType
version, the build would fail in cairo-svg-glyph-renderer.c:

    src/cairo-svg-glyph-render.c:1841:15: error: implicit declaration of
    function ‘cairo_image_surface_create_from_png_stream’; did you mean
    ‘cairo_image_surface_create_for_data’?
    [-Werror=implicit-function-declaration]

Fix this by disabling HAVE_FT_SVG_DOCUMENT when png is not enabled.

Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/784
Signed-off-by: Uli Schlachter <psychon@znc.in>
2023-07-03 18:06:17 +02:00
Emmanuele Bassi
79c6beee90 Merge branch 'drop-xml-surface' into 'master'
Remove XML surface

See merge request cairo/cairo!446
2023-03-02 19:22:44 +00:00
Fujii Hironori
950e3fb45d Change the workaround of MinGW dwrite_3.h problem
The DWRITE_COLOR_GLYPH_RUN1 struct definition of the old MinGW
dwrite_3.h was invalid. To work around the problem, dw-extra.h defined
the correct struct definition and all necessary API from dwrite_3.h.
This approach needed to redefine all necessary API.

This change added DWRITE_COLOR_GLYPH_RUN1_WORKAROUND struct and use it
for IDWriteColorGlyphRunEnumerator1::GetCurrentRun.
2023-02-27 11:55:30 +09:00
Adrian Johnson
d01222a693 Enable COLRv1 fonts
Now that FreeType 2.13.0 has been released with a stable COLRv1 API,
the meson configuration can be updated to enable COLRv1 when this
version is available.
2023-02-09 20:09:08 +10:30
Emmanuele Bassi
2bef8669bc Remove XML surface
According to the Debian code search tool, nothing uses it as part of the
Cairo public API, and it has been disabled for a long time with nobody
complaining about it.
2023-02-04 11:36:25 +01:00
Adrian Johnson
1585587668 dwrite: create C++ dwrite header 2023-01-31 06:54:32 +10:30
Emmanuele Bassi
b5793081d0 Drop cairo-gl
The GL support in Cairo has always been a prototype, and
nothing happened in the past 10+ years to make it work as
it was meant to.

GL support is not enabled by any downstream packagers of
Cairo, so nobody should notice its absence.
2023-01-27 19:21:46 +00:00
Adrian Johnson
d5e8a8c02e We don't use HAVE_CONFIG_H anymore 2023-01-15 19:00:22 +10:30
Fujii Hironori
8520ef5221 Defining Windows version macros in meson.build
WINVER and _WIN32_WINNT macros were defined in each source files and
headers that were including <windows.h>. However, because DirectWrite
requires new Windows API, some files included <windows.h> without the
version macros. This inconsistency sometimes caused troubles.

Define the version macros in meson.build.
2023-01-13 05:47:03 +09:00
Adrian Johnson
dd8f55100a Require -DDEBUG_ENABLE_COLR_V1 to enable the COLR v1 renderer
Once there is a FreeType release where the COLR v1 API is no longer
marked experimental, we can change this to a version check.
2023-01-08 15:15:13 +10:30
Adrian Johnson
3c8dec60e5 Integrate COLR v1 renderer with cairo-ft-font.c 2023-01-08 15:15:13 +10:30
Adrian Johnson
252ff60f1e SVG font test using cairo logo 2022-12-28 13:22:00 +10:30
Adrian Johnson
31700fed4f Support SVG fonts in FT backend 2022-12-28 13:22:00 +10:30
Benjamin Gilbert
6ec9cd3096 meson: allow disabling DWrite
When building with MinGW-w64, DWrite introduces a libstdc++ dependency
which may not be desired.
2022-12-24 20:18:46 -05:00
Luca Bacci
c75220fe08 Remove explicit dependency on libssp
It's not needed anymore.

Linking explicitly with libssp was required for toolchains where the
target libc doesn't implement stack smashing protection routines on
its own, and instead delegates to the generic implementations provided
by libssp. Notably, this was the case of mingw-w64 toolchains.

After discussion upstream with Meson developers [1], the stance taken
is that Meson users (and Meson itself) shall have no knowledge of the
libc internals and whether libssp is required. instead, libc's should
declare a dependency on the generic libssp on their own by means of
.spec files [2].

Following the discussion in Meson Github, the issue was then fixed in
mingw-w64 upstream [3].

References:
 * https://github.com/mesonbuild/meson/issues/10673
 * https://gcc.gnu.org/onlinedocs/gcc/Spec-Files.html
 * https://github.com/msys2/MINGW-packages/issues/13401
2022-10-28 12:44:45 +02:00
Simon McVittie
179c27b1d7 meson: Only link cairo-script-interpreter with liblzo
The rest of cairo (and therefore most external packages that depend
on cairo) doesn't make any use of liblzo.

Signed-off-by: Simon McVittie <smcv@debian.org>
2022-07-18 10:01:38 +01:00
Luca Bacci
c479479b69 Meson: use an array to provide multiple arguments 2022-07-06 12:05:00 +02:00
Adrian Johnson
f0ba2165a6 Add color palette option 2022-06-17 20:42:43 +09:30