1
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-11-24 17:16:18 +00:00
Lakka-LibreELEC/packages/graphics/lcms2/patches/lcms2-370-add-utils-meson.patch
Rudi Heitbaum 4e960c73aa lcms2: update to 2.15
With the change "[RFC] add prefer_static built-in option" (9603)
from https://github.com/mesonbuild/meson
Also: 6697 and 6629

    It is now possible to have meson call pkg-config with the
    --static flag and bring in the Requires.private dependent
    libaries when linking. There is no further need to modify
    the .pc files (or the linker flags.)

    The use of the -Dprefer_static=true will cause the linker
    to prefer and use the static library if it is available,
    which might not be intended if the shared library is also
    available.

    This option will force the static linkage, whereas passing
    the libraries from pkg-config --static to ld would pick
    the shared libraries over the static libraries. With the
    linker options removing any unnecessary libraries:
      -Wl,--as-needed, -Wl,-dead_strip_dylibs

    The example below is how to force the linker to use the
    foo static library when a foo shared library is available.
      gcc main.o -Wl,-Bstatic -lfoo -Wl,-Bdynamic
    Which is what this meson option `prefer_static=true` will
    do for all static libaries that it finds (regardless of
    if shared libraries are available.)

    ref: https://stackoverflow.com/questions/71078862/prefer-static-libraries-but-fallback-to-shared-if-not-found
2023-03-17 13:54:44 +00:00

39 lines
1.4 KiB
Diff

From 0cbb7ac63af7eabb6992361fa0f7ee941deaf0c3 Mon Sep 17 00:00:00 2001
From: Rudi Heitbaum <rudi@heitbaum.com>
Date: Tue, 14 Mar 2023 14:13:11 +0000
Subject: [PATCH] Allow optional build of utils using meson
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
---
meson.build | 5 ++++-
meson_options.txt | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index f0492002b..91152f8aa 100644
--- a/meson.build
+++ b/meson.build
@@ -100,7 +100,10 @@ deps = [m_dep, threads_dep]
subdir('include')
subdir('src')
subdir('testbed')
-subdir('utils')
+
+if get_option('utils')
+ subdir('utils')
+endif
if get_option('samples')
subdir('utils/samples')
diff --git a/meson_options.txt b/meson_options.txt
index 5adc46441..ae41f38cf 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -2,5 +2,6 @@ option('jpeg', type: 'feature', value: 'auto', description: 'Use JPEG')
option('tiff', type: 'feature', value: 'auto', description: 'Use LibTiff')
option('samples', type: 'boolean', value: 'false', description: 'Build the samples')
+option('utils', type: 'boolean', value: 'true', description: 'Build the utils')
option('fastfloat', type: 'boolean', value: 'false', description: 'Build and install the fast float plugin, use only if GPL 3.0 is acceptable')
option('threaded', type: 'boolean', value: 'false', description: 'Build and install the multi threaded plugin, use only if GPL 3.0 is acceptable')