Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Cairo without LZO #1

Merged
merged 3 commits into from
Aug 1, 2023
Merged

Build Cairo without LZO #1

merged 3 commits into from
Aug 1, 2023

Conversation

mike-malburg
Copy link
Contributor

@mike-malburg mike-malburg commented Jul 27, 2023

Description

Update Pango to build Cairo without the use of lzo.

This is done by bringing in the latest of our fork of vcpkg, which now builds Cairo without lzo.

Previously in this PR, we were using an overlay-ports to override vcpkg behavior to exclude lzo. Those changes have been merged into our vcpkg fork: TechSmith/vcpkg#3

@mike-malburg mike-malburg self-assigned this Jul 27, 2023
@mike-malburg mike-malburg force-pushed the add-overlay-ports branch 19 times, most recently from 1318698 to 27cf06b Compare July 28, 2023 17:11
@mike-malburg
Copy link
Contributor Author

mike-malburg commented Jul 28, 2023

The part of this where it is trying to install the custom cairo port seems to be succeeding on my local Mac and Windows machines, but failing on the build agents, and I'm not sure why, yet.

Testing Locally

Below is how I tested this locally on Mac and windows.

Testing on Mac

git clone https://github.com/TechSmith/ThirdParty-vcpkg-build-GTK
cd ThirdParty-vcpkg-build-GTK
git checkout add-overlay-ports
pwsh ./build-cairo.ps1

Testing on Windows

git clone https://github.com/TechSmith/ThirdParty-vcpkg-build-GTK
cd ThirdParty-vcpkg-build-GTK
git checkout add-overlay-ports
./build-cairo.ps1

@mike-malburg
Copy link
Contributor Author

mike-malburg commented Jul 28, 2023

Mac build agent errors

On the Mac build agent, it is erroring out while trying to build cairo-script-operators.c. It seems to be getting into this block to try to add this include:

From cairo-script-operators.c:

...
#if HAVE_LZO
#include <lzo/lzo2a.h>
#endif
...

It should not be hitting this, however, because this should be failing to set HAVE_LZO to 1 in cairo's build.meson file:

From build.meson:

...
lzo_dep = dependency('lzo2', required: false)
if lzo_dep.found()
  conf.set('HAVE_LZO', 1)
endif
...

One possible solution might be to add a custom patch for build.meson in our custom port of cairo. It is still pretty strange that the build agent seems to be hitting this, however, and I am not hitting it locally. It makes me wonder what other kinds of errors we might see if we don't fix the root cause of this on the agent.

Error info
Installing 20/20 cairo:x64-osx-dynamic-release...
Building cairo[core,fontconfig,freetype]:x64-osx-dynamic-release...
-- [OVERLAY] Loading triplet configuration from: /Users/runner/work/1/s/triplets/x64-osx-dynamic-release.cmake
-- Installing port from location: /Users/runner/work/1/s/custom-ports/cairo
-- Downloading https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.17.8/cairo-1.17.8.tar.gz -> cairo-cairo-1.17.8.tar.gz...
-- Extracting source /Users/runner/work/1/s/vcpkg/downloads/cairo-cairo-1.17.8.tar.gz
-- Applying patch cairo_static_fix.patch
-- Applying patch disable-atomic-ops-check.patch
-- Applying patch mingw-dllexport.patch
-- Applying patch fix-static-missing-lib-msimg32.patch
-- Using source at /Users/runner/work/1/s/vcpkg/buildtrees/cairo/src/1.17.8-b6ef588821.clean
-- Getting CMake variables for x64-osx-dynamic-release-rel
-- Configuring x64-osx-dynamic-release-rel
-- Configuring x64-osx-dynamic-release-rel done
-- Package x64-osx-dynamic-release-rel
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:112 (message):
    Command failed: /Users/runner/work/1/s/vcpkg/downloads/tools/ninja/1.10.2-osx/ninja install -v
    Working Directory: /Users/runner/work/1/s/vcpkg/buildtrees/cairo/x64-osx-dynamic-release-rel
    Error code: 1
    See logs for more information:
      /Users/runner/work/1/s/vcpkg/buildtrees/cairo/package-x64-osx-dynamic-release-rel-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_meson.cmake:33 (vcpkg_execute_required_process)
  /Users/runner/work/1/s/custom-ports/cairo/portfile.cmake:61 (vcpkg_install_meson)
  scripts/ports.cmake:147 (include)


error: building cairo:x64-osx-dynamic-release failed with: BUILD_FAILED
Elapsed time to handle cairo:x64-osx-dynamic-release: 26 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+cairo
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?title=[cairo]+Build+error&body=Copy+issue+body+from+%2FUsers%2Frunner%2Fwork%2F1%2Fs%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
You can also sumbit an issue by running (GitHub cli must be installed):
    gh issue create -R microsoft/vcpkg --title "[cairo] Build failure" --body-file /Users/runner/work/1/s/vcpkg/installed/vcpkg/issue_body.md
Contents of `vcpkg/buildtrees/cairo/package-x64-osx-dynamic-release-rel-out.log`
[1/152] /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Iutil/cairo-script/libcairo-script-interpreter.2.dylib.p -Iutil/cairo-script -I../src/1.17.8-b6ef588821.clean/util/cairo-script -I. -I../src/1.17.8-b6ef588821.clean -Isrc -I../src/1.17.8-b6ef588821.clean/src -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/libpng16 -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/pixman-1 -I/usr/local/Cellar/lzo/2.10/include/lzo -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -O0 -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -Wno-unused-but-set-variable -Wno-enum-conversion -fno-strict-aliasing -fno-common -D_GNU_SOURCE -fPIC -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -O3 -DNDEBUG -MD -MQ util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-file.c.o -MF util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-file.c.o.d -o util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-file.c.o -c ../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-file.c
FAILED: util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-file.c.o 
/Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Iutil/cairo-script/libcairo-script-interpreter.2.dylib.p -Iutil/cairo-script -I../src/1.17.8-b6ef588821.clean/util/cairo-script -I. -I../src/1.17.8-b6ef588821.clean -Isrc -I../src/1.17.8-b6ef588821.clean/src -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/libpng16 -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/pixman-1 -I/usr/local/Cellar/lzo/2.10/include/lzo -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -O0 -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -Wno-unused-but-set-variable -Wno-enum-conversion -fno-strict-aliasing -fno-common -D_GNU_SOURCE -fPIC -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -O3 -DNDEBUG -MD -MQ util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-file.c.o -MF util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-file.c.o.d -o util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-file.c.o -c ../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-file.c
../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-file.c:45:10: fatal error: 'lzo/lzo2a.h' file not found
#include <lzo/lzo2a.h>
         ^~~~~~~~~~~~~
1 error generated.
[2/152] /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Iutil/cairo-script/libcairo-script-interpreter.2.dylib.p -Iutil/cairo-script -I../src/1.17.8-b6ef588821.clean/util/cairo-script -I. -I../src/1.17.8-b6ef588821.clean -Isrc -I../src/1.17.8-b6ef588821.clean/src -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/libpng16 -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/pixman-1 -I/usr/local/Cellar/lzo/2.10/include/lzo -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -O0 -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -Wno-unused-but-set-variable -Wno-enum-conversion -fno-strict-aliasing -fno-common -D_GNU_SOURCE -fPIC -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -O3 -DNDEBUG -MD -MQ util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-hash.c.o -MF util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-hash.c.o.d -o util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-hash.c.o -c ../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-hash.c
[3/152] /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Iutil/cairo-script/libcairo-script-interpreter.2.dylib.p -Iutil/cairo-script -I../src/1.17.8-b6ef588821.clean/util/cairo-script -I. -I../src/1.17.8-b6ef588821.clean -Isrc -I../src/1.17.8-b6ef588821.clean/src -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/libpng16 -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/pixman-1 -I/usr/local/Cellar/lzo/2.10/include/lzo -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -O0 -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -Wno-unused-but-set-variable -Wno-enum-conversion -fno-strict-aliasing -fno-common -D_GNU_SOURCE -fPIC -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -O3 -DNDEBUG -MD -MQ util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o -MF util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o.d -o util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o -c ../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-operators.c
FAILED: util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o 
/Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Iutil/cairo-script/libcairo-script-interpreter.2.dylib.p -Iutil/cairo-script -I../src/1.17.8-b6ef588821.clean/util/cairo-script -I. -I../src/1.17.8-b6ef588821.clean -Isrc -I../src/1.17.8-b6ef588821.clean/src -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/libpng16 -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/pixman-1 -I/usr/local/Cellar/lzo/2.10/include/lzo -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -O0 -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -Wno-unused-but-set-variable -Wno-enum-conversion -fno-strict-aliasing -fno-common -D_GNU_SOURCE -fPIC -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -O3 -DNDEBUG -MD -MQ util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o -MF util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o.d -o util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-operators.c.o -c ../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-operators.c
../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-operators.c:63:10: fatal error: 'lzo/lzo2a.h' file not found
#include <lzo/lzo2a.h>
         ^~~~~~~~~~~~~
1 error generated.
[4/152] /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Iutil/cairo-script/libcairo-script-interpreter.2.dylib.p -Iutil/cairo-script -I../src/1.17.8-b6ef588821.clean/util/cairo-script -I. -I../src/1.17.8-b6ef588821.clean -Isrc -I../src/1.17.8-b6ef588821.clean/src -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/libpng16 -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/pixman-1 -I/usr/local/Cellar/lzo/2.10/include/lzo -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -O0 -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -Wno-unused-but-set-variable -Wno-enum-conversion -fno-strict-aliasing -fno-common -D_GNU_SOURCE -fPIC -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -O3 -DNDEBUG -MD -MQ util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-objects.c.o -MF util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-objects.c.o.d -o util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-objects.c.o -c ../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-objects.c
[5/152] /Applications/Xcode_14.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -Iutil/cairo-script/libcairo-script-interpreter.2.dylib.p -Iutil/cairo-script -I../src/1.17.8-b6ef588821.clean/util/cairo-script -I. -I../src/1.17.8-b6ef588821.clean -Isrc -I../src/1.17.8-b6ef588821.clean/src -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/libpng16 -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/lib/pkgconfig/../../include/pixman-1 -I/usr/local/Cellar/lzo/2.10/include/lzo -I/Users/runner/work/1/s/vcpkg/installed/x64-osx-dynamic-release/include -fcolor-diagnostics -Wall -Winvalid-pch -Wextra -O0 -Wmissing-declarations -Werror-implicit-function-declaration -Wpointer-arith -Wwrite-strings -Wsign-compare -Wpacked -Wswitch-enum -Wmissing-format-attribute -Wvolatile-register-var -Wstrict-aliasing=2 -Winit-self -Wno-missing-field-initializers -Wno-unused-parameter -Wno-attributes -Wno-long-long -Winline -Wno-unused-but-set-variable -Wno-enum-conversion -fno-strict-aliasing -fno-common -D_GNU_SOURCE -fPIC -isysroot /Applications/Xcode_14.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk -mmacosx-version-min=12.6 -O3 -DNDEBUG -MD -MQ util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-interpreter.c.o -MF util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-interpreter.c.o.d -o util/cairo-script/libcairo-script-interpreter.2.dylib.p/cairo-script-interpreter.c.o -c ../src/1.17.8-b6ef588821.clean/util/cairo-script/cairo-script-interpreter.c
ninja: build stopped: subcommand failed.

@mike-malburg
Copy link
Contributor Author

mike-malburg commented Jul 28, 2023

Windows build agent errors

On the windows build agent, is is failing to apply the patch in our custom port of cairo called cairo_static_fix.patch with error "corrupt patch at line 5". I'm not sure what is causing this.

Error info
Installing 21/21 cairo:x64-windows-release...
Building cairo[core,fontconfig,freetype]:x64-windows-release...
warning: -- Using community triplet x64-windows-release. This triplet configuration is not guaranteed to succeed.
-- [COMMUNITY] Loading triplet configuration from: D:\a\1\s\vcpkg\triplets\community\x64-windows-release.cmake
-- Installing port from location: D:\a\1\s\custom-ports\cairo
-- Downloading https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.17.8/cairo-1.17.8.tar.gz -> cairo-cairo-1.17.8.tar.gz...
-- Extracting source D:/a/1/s/vcpkg/downloads/cairo-cairo-1.17.8.tar.gz
-- Applying patch cairo_static_fix.patch
CMake Error at scripts/cmake/z_vcpkg_apply_patches.cmake:34 (message):
  Applying patch failed: error: corrupt patch at line 5

Call Stack (most recent call first):
  scripts/cmake/vcpkg_extract_source_archive.cmake:153 (z_vcpkg_apply_patches)
  scripts/cmake/vcpkg_extract_source_archive_ex.cmake:8 (vcpkg_extract_source_archive)
  scripts/cmake/vcpkg_from_gitlab.cmake:125 (vcpkg_extract_source_archive_ex)
  D:/a/1/s/custom-ports/cairo/portfile.cmake:5 (vcpkg_from_gitlab)
  scripts/ports.cmake:147 (include)


error: building cairo:x64-windows-release failed with: BUILD_FAILED
Elapsed time to handle cairo:x64-windows-release: 5 s
Please ensure you're using the latest port files with `git pull` and `vcpkg update`.
Then check for known issues at:
    https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+cairo
You can submit a new issue at:
    https://github.com/microsoft/vcpkg/issues/new?title=[cairo]+Build+error&body=Copy+issue+body+from+D%3A%2Fa%2F1%2Fs%2Fvcpkg%2Finstalled%2Fvcpkg%2Fissue_body.md
You can also sumbit an issue by running (GitHub cli must be installed):
    gh issue create -R microsoft/vcpkg --title "[cairo] Build failure" --body-file D:/a/1/s/vcpkg/installed/vcpkg/issue_body.md
Contents of `custom-ports/cairo/cairo_static_fix.patch`
--- meson.build.orig	2022-03-19 03:40:07.000000000 +0900
+++ meson.build	2022-03-29 21:32:41.000000000 +0900
@@ -96,6 +96,13 @@
 endif

 add_project_arguments('-D_GNU_SOURCE', language: 'c')
 
+if host_machine.system() == 'windows'
+  lib_default = get_option('default_library')
+  if lib_default == 'static'
+    add_project_arguments('-DCAIRO_WIN32_STATIC_BUILD', language: 'c')
+  endif
+endif
+
 # Make sure source directory hasn't been configured with autotools
 fs = import('fs')
 if fs.exists('config.h') or fs.exists('src/cairo-features.h') or fs.exists('src/cairo-supported-features.h')

@dchengTSC dchengTSC changed the title Add overlay ports Build Cairo with LZO Aug 1, 2023
@dchengTSC dchengTSC changed the title Build Cairo with LZO Build Cairo without LZO Aug 1, 2023
@dchengTSC dchengTSC merged commit e3b8132 into main Aug 1, 2023
3 checks passed
@dchengTSC dchengTSC deleted the add-overlay-ports branch August 1, 2023 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants