[gimp/alxsa-openmp-dependency] build: Add support for OpenMP dependency




commit 6504afb6632fce2c79eedf062e33ede5fdc6b3a0
Author: Alx Sa <cmyk student gmail com>
Date:   Sun Oct 9 22:36:11 2022 +0000

    build: Add support for OpenMP dependency
    
    Enables general support for OpenMP.
    Currently, only the DDS plug-in utilizes it.

 configure.ac                  |  6 ++++++
 meson.build                   | 12 +++++++++++-
 plug-ins/file-dds/Makefile.am |  2 +-
 plug-ins/file-dds/meson.build |  1 +
 4 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 713feb0b0b..e7bd60038d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1371,6 +1371,12 @@ if test "x$enable_mp" != "xno"; then
            [Define to 1 to enable support for multiple processors.])
 fi
 
+AC_ARG_ENABLE(openmp, [  --disable-openmp            disable support for OpenMP])
+
+if test "x$enable_openmp" != "xno"; then
+  AC_DEFINE(ENABLE_OPENMP, 1,
+           [Define to 1 to enable support for OpenMP.])
+fi
 
 ################################
 # Some plug-ins are X11 specific
diff --git a/meson.build b/meson.build
index 149065b6d9..06a54c8065 100644
--- a/meson.build
+++ b/meson.build
@@ -834,7 +834,7 @@ if openjpeg.found()
   MIMEtypes += [ 'image/jp2', 'image/jpeg2000', 'image/jpx', ]
 endif
 
-jpegxl_minver  = '0.7.0'
+jpegxl_minver  = '0.6.1'
 libjxl         = dependency('libjxl',
                             version: '>='+jpegxl_minver,
                             required: get_option('jpeg-xl')
@@ -1246,6 +1246,15 @@ conf.set('HAVE_GETTEXT', true)
 # Enable support for multiprocessing
 conf.set10('ENABLE_MP', get_option('enable-multiproc'))
 
+# Enable support for OpenMP
+openmp = dependency('openmp', required : false)
+if openmp.found()
+  have_openmp = true
+else
+  have_openmp = false
+endif
+conf.set('HAVE_OPENMP', have_openmp)
+
 # Check for available functions
 foreach fn : [
     { 'm': 'HAVE_ALLOCA',                   'v': 'alloca', },
@@ -1821,6 +1830,7 @@ final_message = [
 '''  32-bit DLL folder (Win32): @0@'''.format(get_option('win32-32bits-dll-folder')),
 '''  Detailed backtraces:       @0@'''.format(detailed_backtraces),
 '''  Binary symlinks:           @0@'''.format(enable_default_bin),
+'''  OpenMP:                    @0@'''.format(have_openmp),
 '',
 '''Optional Plug-Ins:''',
 '''  Ascii Art:           @0@'''.format(libaa.found()),
diff --git a/plug-ins/file-dds/Makefile.am b/plug-ins/file-dds/Makefile.am
index 3df17b839a..ff578dad37 100644
--- a/plug-ins/file-dds/Makefile.am
+++ b/plug-ins/file-dds/Makefile.am
@@ -20,7 +20,7 @@ file_dds_RC = file-dds.rc.o
 endif
 
 AM_LDFLAGS = $(mwindows)
-AM_CFLAGS = -fno-strict-aliasing
+AM_CFLAGS = -fno-strict-aliasing -fopenmp
 
 libexecdir = $(gimpplugindir)/plug-ins/file-dds
 
diff --git a/plug-ins/file-dds/meson.build b/plug-ins/file-dds/meson.build
index b8a47ee88f..9a2dd8d27f 100644
--- a/plug-ins/file-dds/meson.build
+++ b/plug-ins/file-dds/meson.build
@@ -29,6 +29,7 @@ executable(plugin_name,
   dependencies: [
     libgimpui_dep,
     math,
+    openmp,
   ],
   install: true,
   install_dir: gimpplugindir / 'plug-ins' / plugin_name,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]