1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00

build: Add support for OpenMP dependency

Enables general support for OpenMP.
Currently, only the DDS plug-in utilizes it.
This commit is contained in:
Alx Sa
2022-10-09 22:36:11 +00:00
committed by Jehan
parent 11495ea4fd
commit 74b32f7c86
4 changed files with 23 additions and 1 deletions

View File

@@ -1373,6 +1373,17 @@ if test "x$enable_mp" != "xno"; then
[Define to 1 to enable support for multiple processors.])
fi
enable_openmp=no
m4_ifdef([AC_OPENMP], [AC_OPENMP], [AX_OPENMP([enable_openmp=yes],[enable_openmp=no])])
if test "x$ac_cv_prog_c_openmp" != "xunsupported" && test "x$ac_cv_prog_c_openmp" != "x"; then
enable_openmp=yes
fi
if test "x$enable_openmp" = "xyes"; then
AC_DEFINE(USE_OPENMP, 1, [Define to 1 to enable support for OpenMP])
CFLAGS="$CFLAGS $(OPENMP_CFLAGS)"
fi
################################
# Some plug-ins are X11 specific

View File

@@ -1256,6 +1256,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', },
@@ -1831,6 +1840,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()),

View File

@@ -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

View File

@@ -29,6 +29,7 @@ executable(plugin_name,
dependencies: [
libgimpui_dep,
math,
openmp,
],
install: true,
install_dir: gimpplugindir / 'plug-ins' / plugin_name,