https://bugs.kde.org/show_bug.cgi?id=501769

            Bug ID: 501769
           Summary: Build uses -Werror=undef, which makes it fail
    Classification: Applications
           Product: digikam
           Version: 8.6.0
          Platform: NetBSD pkgsrc
                OS: NetBSD
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Portability-Compilation
          Assignee: digikam-bugs-n...@kde.org
          Reporter: w...@gatalith.at
  Target Milestone: ---

When compiling digikam 8.6.0 using dependencies from pkgsrc on NetBSD
10.99.12/x86_64, in particular x265-4.1 and jasper-4.2.4, I see the following
compilation error:

In file included from
/scratch/wip/digikam/work/.buildlink/include/jasper/jas_version.h:73,
                 from
/scratch/wip/digikam/work/digikam-8.6.0/core/libs/dialogs/libsinfodlg.cpp:119:
/scratch/wip/digikam/work/.buildlink/include/jasper/jas_config.h:116:6: error:
"__STDC_VERSION__" is not defined, evaluates to 0 [-Werror=undef]
  116 | #if (__STDC_VERSION__ - 0 < JAS_STDC_VERSION)
      |      ^~~~~~~~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/jasper/jas_config.h:117:2:
warning: #warning "Your code is being built against an older version of the C
standard than JasPer was.  Although this is supported, this may require some
extra preprocessor defines when building." [-Wcpp]
  117 | #warning "Your code is being built against an older version of the C
standard than JasPer was.  Although this is supported, this may require some
extra preprocessor defines when building."
      |  ^~~~~~~
In file included from
/scratch/wip/digikam/work/digikam-8.6.0/core/libs/dialogs/libsinfodlg.cpp:151:
/scratch/wip/digikam/work/.buildlink/include/x265.h:35:5: error: "_MSC_VER" is
not defined, evaluates to 0 [-Werror=undef]
   35 | #if _MSC_VER
      |     ^~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:186:5: error: "X265_DEPTH"
is not defined, evaluates to 0 [-Werror=undef]
  186 | #if X265_DEPTH < 10
      |     ^~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:643:5: error:
"ENABLE_MULTIVIEW" is not defined, evaluates to 0 [-Werror=undef]
  643 | #if ENABLE_MULTIVIEW
      |     ^~~~~~~~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:650:5: error:
"ENABLE_ALPHA" is not defined, evaluates to 0 [-Werror=undef]
  650 | #if ENABLE_ALPHA
      |     ^~~~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:656:5: error:
"ENABLE_ALPHA" is not defined, evaluates to 0 [-Werror=undef]
  656 | #if ENABLE_ALPHA || ENABLE_MULTIVIEW
      |     ^~~~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:656:21: error:
"ENABLE_MULTIVIEW" is not defined, evaluates to 0 [-Werror=undef]
  656 | #if ENABLE_ALPHA || ENABLE_MULTIVIEW
      |                     ^~~~~~~~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:665:5: error:
"ENABLE_SCC_EXT" is not defined, evaluates to 0 [-Werror=undef]
  665 | #if ENABLE_SCC_EXT
      |     ^~~~~~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:2400:5: error:
"ENABLE_SCC_EXT" is not defined, evaluates to 0 [-Werror=undef]
 2400 | #if ENABLE_SCC_EXT
      |     ^~~~~~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:2618:5: error:
"ENABLE_LIBVMAF" is not defined, evaluates to 0 [-Werror=undef]
 2618 | #if ENABLE_LIBVMAF
      |     ^~~~~~~~~~~~~~
/scratch/wip/digikam/work/.buildlink/include/x265.h:2690:5: error:
"ENABLE_LIBVMAF" is not defined, evaluates to 0 [-Werror=undef]
 2690 | #if ENABLE_LIBVMAF
      |     ^~~~~~~~~~~~~~

Removing -Werror=undef (via the pkgsrc compiler wrapper) allows the build to
finish.

I must confess I'm not sure where it originates from. Grepping the digikam
sources I can't find it being set, but after running cmake, it is there all
over the place, e.g.

work/digikam-8.6.0/_KDE_build/CMakeFiles/CMakeConfigureLog.yaml:     
CMAKE_CXX_FLAGS: "-O2 -g -fstack-clash-protection -pthread -I/usr/pkg/include
-I/usr/include -I/usr/pkg/include/ImageMagick-7 -I/usr/pkg/include/freet
ype2 -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0
-I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include/harfbuzz
-I/usr/pkg/include/opencv4 -I/usr/pkg/include/ffmpeg6 -I/usr/pkg/include/libdrm
-I/usr/pkg/qt6/
include -I/usr/pkg/include/gstreamer-1.0 -fno-operator-names -fno-exceptions
-Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long
-Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -
Werror=return-type -Werror=init-self -Werror=undef -Wvla"

or

work/digikam-8.6.0/_KDE_build/build.ninja:  FLAGS = -O2 -g
-fstack-clash-protection -pthread -I/usr/pkg/include -I/usr/include
-I/usr/pkg/include/ImageMagick-7 -I/usr/pkg/include/freetype2
-I/usr/pkg/include/glib-2.0 -I/
usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include
-I/usr/pkg/include/harfbuzz -I/usr/pkg/include/opencv4
-I/usr/pkg/include/ffmpeg6 -I/usr/pkg/include/libdrm -I/usr/pkg/qt6/include
-I/usr/pkg/include/gstreamer
-1.0 -fno-operator-names -Wall -Wextra  -Wchar-subscripts -Wformat-security
-Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual
-Werror=return-type -Werror=init-self -Werror=undef -Wvla -Wdate-
time  -Wlogical-op   -Wmissing-include-dirs -fdiagnostics-color=always
-Wno-deprecated-copy -fexceptions -fexceptions -std=c++20 -fPIC
-fvisibility=hidden -fvisibility-inlines-hidden

In the cmake output I even see:

-- Remove GCC compiler option -Wundef from
/scratch/wip/digikam/work/digikam-8.6.0/core/libs/rawengine

so it seems a similar problem was already addressed before.
Perhaps you have some advice on where it comes from or how to avoid it.

(I have a workaround in place for pkgsrc, but thought that users compiling
outside pkgsrc might stuble over this, so I thought it better to report this.)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to