Ubuntu 24.04 configure and build warnings

Aperta
#842 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cmake, cpp, ubuntu

Direzione di ricerca

Reproduce the warnings with the provided Ubuntu 24.04 Dockerfile, then read the CMake configuration and the named warning locations, including lib/ZenKit/vendor/libsquish/CMakeLists.txt and lib/bullet3/CMakeLists.txt. The issue lists several warnings across build configuration and third-party code but does not specify which should be addressed; clarify the intended scope before treating the warnings as resolved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hi, when building this natively I got several warnings. Not sure if these are already known from before, but I could not find any issues that listed these so...

CMake configuration warnings

When running cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
I got the following warnings:

CMake Warning (dev) at lib/ZenKit/vendor/libsquish/CMakeLists.txt:21 (OPTION):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'BUILD_SHARED_LIBS'.
This warning is for project developers.  Use -Wno-dev to suppress it.

[...]

CMake Warning (dev) at /usr/share/cmake-3.28/Modules/FindOpenGL.cmake:381 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  lib/bullet3/CMakeLists.txt:312 (FIND_PACKAGE)
This warning is for project developers.  Use -Wno-dev to suppress it.

Build warnings

When building with cmake --build ./build --target Gothic2Notr I get these warnings:

~/OpenGothic/OpenGothic/lib/Tempest/Engine/thirdparty/openal-soft/common/pffft.cpp:1470:18: warning: ignoring attributes on template argument ‘{anonymous}::v4sf’ {aka ‘{anonymous}::__m128’} [-Wignored-attributes]
 1470 |     al::span<v4sf> e; /* N/4*3 elements */
      |                  ^
cc1plus: note: unrecognized command-line option ‘-Wno-c++20-attribute-extensions’ may have been intended to silence earlier diagnostics

[...]

~/OpenGothic/OpenGothic/lib/Tempest/Engine/thirdparty/openal-soft/al/buffer.cpp: In function ‘void {anonymous}::FreeBuffer(ALCdevice*, ALbuffer*)’:
~/OpenGothic/OpenGothic/lib/Tempest/Engine/thirdparty/openal-soft/al/buffer.cpp:221:28: warning: unused parameter ‘device’ [-Wunused-parameter]
  221 | void FreeBuffer(ALCdevice *device, ALbuffer *buffer)
      |                 ~~~~~~~~~~~^~~~~~
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-c++20-attribute-extensions’ may have been intended to silence earlier diagnostics

[...]

~/OpenGothic/OpenGothic/lib/Tempest/Engine/thirdparty/openal-soft/al/effects/vmorpher.cpp: In static member function ‘static void VmorpherEffectHandler::SetParami(VmorpherProps&, ALenum, int)’:
~/OpenGothic/OpenGothic/lib/Tempest/Engine/thirdparty/openal-soft/al/effects/vmorpher.cpp:23:42: warning: inlining failed in call to ‘constexpr std::optional<VMorpherPhenome> {anonymous}::PhenomeFromEnum(ALenum) noexcept’: --param max-inline-insns-single limit reached [-Winline]
   23 | constexpr std::optional<VMorpherPhenome> PhenomeFromEnum(ALenum val) noexcept
      |                                          ^~~~~~~~~~~~~~~
~/OpenGothic/OpenGothic/lib/Tempest/Engine/thirdparty/openal-soft/al/effects/vmorpher.cpp:146:45: note: called from here
  146 |         if(auto phenomeopt = PhenomeFromEnum(val))
      |                              ~~~~~~~~~~~~~~~^~~~~

[...]

etc, there are quite a few warnings printed.

Reproducer

Here is a reproducer that generates the same errors, just run the following command with the provided dockerfile

podman build . --tag reproducer
# Dockerfile
FROM ubuntu:24.04

ENV UBUNTU_CODENAME="noble"
RUN apt-get update
RUN apt-get --assume-yes install wget gnupg2 git

RUN wget -qO - http://packages.lunarg.com/lunarg-signing-key-pub.asc | apt-key add -
RUN wget -qO /etc/apt/sources.list.d/lunarg-vulkan-${UBUNTU_CODENAME}.list http://packages.lunarg.com/vulkan/lunarg-vulkan-${UBUNTU_CODENAME}.list
RUN apt-get update
RUN apt-get --assume-yes install vulkan-sdk

RUN apt-get --assume-yes install git cmake g++ glslang-tools libvulkan-dev libasound2-dev libx11-dev libxcursor-dev

RUN git clone https://github.com/Try/OpenGothic.git
RUN cd OpenGothic && git clone --recurse-submodules https://github.com/Try/OpenGothic.git

RUN cd OpenGothic/OpenGothic && cmake -B build -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
RUN cd OpenGothic/OpenGothic && make -C build -j $(nproc)
Lingua principale
C++
Stelle
1.6k
Fork
138
Merge medio
4g 21h
PR unite (30g)
11

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Try/OpenGothic

Tutte le issue di Try/OpenGothic

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.