From 4f27b40cd84629414205f7962a96f42b7599635a Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sat, 15 Jun 2024 22:48:28 +0100 Subject: [PATCH 1/6] Run CMake with -Werror=dev in CI --- .github/workflows/build.yml | 4 ++++ CMakeLists.txt | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b80d5df75b8..83eccea92ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ jobs: container: ghcr.io/lmms/linux.gcc:20.04 env: CMAKE_OPTS: >- + -Werror=dev -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_COMPILE_CACHE=ON @@ -79,6 +80,7 @@ jobs: runs-on: ${{ matrix.os }} env: CMAKE_OPTS: >- + -Werror=dev -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_COMPILE_CACHE=ON @@ -168,6 +170,7 @@ jobs: container: ghcr.io/lmms/linux.mingw:20.04 env: CMAKE_OPTS: >- + -Werror=dev -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_COMPILE_CACHE=ON @@ -276,6 +279,7 @@ jobs: -B build ` -G Ninja ` --toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake ` + -Werror=dev ` -DCMAKE_BUILD_TYPE=RelWithDebInfo ` -DUSE_COMPILE_CACHE=ON ` -DVCPKG_TARGET_TRIPLET="${{ matrix.arch }}-windows" ` diff --git a/CMakeLists.txt b/CMakeLists.txt index fbd9cdfcf1b..0d3e899fb6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,8 +15,6 @@ function(enable_policy_if_exists id) endif() endfunction() -# Needed for the SWH Ladspa plugins. See below. -enable_policy_if_exists(CMP0074) # find_package() uses _ROOT variables. # Needed for ccache support with MSVC enable_policy_if_exists(CMP0141) # MSVC debug information format flags are selected by an abstraction. From edf7f926b90adbf45cc18d59a542ce6f1a04bd5c Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sat, 15 Jun 2024 23:07:14 +0100 Subject: [PATCH 2/6] Fix names for find_package_handle_standard_args --- cmake/modules/FindSndio.cmake | 2 +- cmake/modules/FindSoundIo.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindSndio.cmake b/cmake/modules/FindSndio.cmake index e993702c29e..a1b24d06c5b 100644 --- a/cmake/modules/FindSndio.cmake +++ b/cmake/modules/FindSndio.cmake @@ -24,7 +24,7 @@ check_library_exists(sndio sio_open "${SNDIO_LIBRARY_DIR}" HAVE_SIO_OPEN) find_path(SNDIO_INCLUDE_DIR sndio.h) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SNDIO DEFAULT_MSG SNDIO_LIBRARY SNDIO_INCLUDE_DIR HAVE_SIO_OPEN) +find_package_handle_standard_args(Sndio DEFAULT_MSG SNDIO_LIBRARY SNDIO_INCLUDE_DIR HAVE_SIO_OPEN) if(SNDIO_FOUND) set(SNDIO_INCLUDE_DIRS "${SNDIO_INCLUDE_DIR}") diff --git a/cmake/modules/FindSoundIo.cmake b/cmake/modules/FindSoundIo.cmake index 0d905ecf21c..f5948f06156 100644 --- a/cmake/modules/FindSoundIo.cmake +++ b/cmake/modules/FindSoundIo.cmake @@ -11,6 +11,6 @@ find_path(SOUNDIO_INCLUDE_DIR NAMES soundio/soundio.h) find_library(SOUNDIO_LIBRARY NAMES soundio) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SOUNDIO DEFAULT_MSG SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR) +find_package_handle_standard_args(SoundIo DEFAULT_MSG SOUNDIO_LIBRARY SOUNDIO_INCLUDE_DIR) mark_as_advanced(SOUNDIO_INCLUDE_DIR SOUNDIO_LIBRARY) From 07dc9236ccb8fac6e6792752cf23ca1bddc97a96 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sat, 15 Jun 2024 23:15:31 +0100 Subject: [PATCH 3/6] Use FindPkgConfig properly --- cmake/modules/FindPulseAudio.cmake | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/cmake/modules/FindPulseAudio.cmake b/cmake/modules/FindPulseAudio.cmake index 8ea2616cf53..0023d1d6329 100644 --- a/cmake/modules/FindPulseAudio.cmake +++ b/cmake/modules/FindPulseAudio.cmake @@ -18,13 +18,15 @@ ENDIF (PULSEAUDIO_INCLUDE_DIR AND PULSEAUDIO_LIBRARIES) IF (NOT WIN32) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls - INCLUDE(FindPkgConfig) - pkg_check_modules(PA libpulse) - set(_PASIncDir ${PA_INCLUDE_DIRS}) - set(_PASLinkDir ${PA_LIBRARY_DIRS}) - set(_PASLinkFlags ${PA_LDFLAGS}) - set(_PASCflags ${PA_CFLAGS}) - SET(PULSEAUDIO_DEFINITIONS ${_PASCflags}) + find_package(PkgConfig QUIET) + if(PKG_CONFIG_FOUND) + pkg_check_modules(PA libpulse) + set(_PASIncDir ${PA_INCLUDE_DIRS}) + set(_PASLinkDir ${PA_LIBRARY_DIRS}) + set(_PASLinkFlags ${PA_LDFLAGS}) + set(_PASCflags ${PA_CFLAGS}) + set(PULSEAUDIO_DEFINITIONS ${_PASCflags}) + endif() ENDIF (NOT WIN32) FIND_PATH(PULSEAUDIO_INCLUDE_DIR pulse/pulseaudio.h From fe8aca5a83496189c192c0131587f62245d89d55 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sat, 15 Jun 2024 23:36:14 +0100 Subject: [PATCH 4/6] Disable for Linux, allow deprecated for MinGW --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83eccea92ce..d3dcf5cd587 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,6 @@ jobs: container: ghcr.io/lmms/linux.gcc:20.04 env: CMAKE_OPTS: >- - -Werror=dev -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_COMPILE_CACHE=ON @@ -171,6 +170,7 @@ jobs: env: CMAKE_OPTS: >- -Werror=dev + -Wno-error=deprecated -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_COMPILE_CACHE=ON From 59cec4d24e57a71cfa53d977e513e0240bf7864b Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sun, 16 Jun 2024 00:03:11 +0100 Subject: [PATCH 5/6] Correct deprecation flag --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3dcf5cd587..66b9a9414bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,8 +169,8 @@ jobs: container: ghcr.io/lmms/linux.mingw:20.04 env: CMAKE_OPTS: >- + -Wdeprecated -Werror=dev - -Wno-error=deprecated -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_COMPILE_CACHE=ON From 57bd662f99afe5131f7c9247332ae4aa5ac4dbe8 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Fri, 5 Jul 2024 23:39:52 +0100 Subject: [PATCH 6/6] Re-enable deprecation errors for MinGW jobs --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8fa11a4063..14c617b6566 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -177,7 +177,6 @@ jobs: container: ghcr.io/lmms/linux.mingw:20.04 env: CMAKE_OPTS: >- - -Wdeprecated -Werror=dev -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo