Fix vcpkg builds (#7702)

* Try to fix MSVC linker error related to lilv

* Remove temporary workaround

* Temporary debugging messages

* oops

* Temporary debugging

* Try to find FluidSynth using Config mode first

* Try again to fix lilv

* Fix FluidSynth installed with vcpkg on Windows

* Fix lilv from vcpkg

* Remove debug flag

* Fix for when lilv is not found (*-NOTFOUND evaluates to false)

* Use lowercase package name for lv2

* Try using only pkg_check_modules for lv2

* Use Lilv::lilv

* Add pkg-config guard back in

* Fix package name

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>

* Fix Lilv_INCLUDE_DIRS

* Rename vcpkg cache key

---------

Co-authored-by: Tres Finocchiaro <tres.finocchiaro@gmail.com>
This commit is contained in:
Dalton Messmer
2025-02-12 20:19:13 -05:00
committed by GitHub
parent 67d4a1ca61
commit 7d271e4f39
7 changed files with 51 additions and 39 deletions

View File

@@ -317,19 +317,13 @@ jobs:
with:
fetch-depth: 0
submodules: recursive
- name: Update vcpkg (TEMPORARY)
run: |
cd $env:VCPKG_INSTALLATION_ROOT
git pull
.\bootstrap-vcpkg.bat
shell: pwsh
- name: Cache vcpkg dependencies
id: cache-deps
uses: actions/cache@v3
with:
key: vcpkg-x64-${{ hashFiles('vcpkg.json') }}
key: vcpkg-msvc-x86_64-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-x64-
vcpkg-msvc-x86_64-
path: build\vcpkg_installed
- name: Cache ccache data
uses: actions/cache@v3

View File

@@ -240,29 +240,28 @@ if(LMMS_BUILD_APPLE)
endif()
find_package(Perl)
IF(WANT_LV2)
IF(PKG_CONFIG_FOUND)
PKG_CHECK_MODULES(LV2 lv2)
PKG_CHECK_MODULES(LILV lilv-0)
ENDIF()
IF(NOT LV2_FOUND AND NOT LILV_FOUND)
UNSET(LV2_FOUND CACHE)
UNSET(LILV_FOUND CACHE)
FIND_PACKAGE(LV2 CONFIG)
FIND_PACKAGE(LILV CONFIG)
IF(LILV_FOUND)
SET(LILV_LIBRARIES "lilv::lilv")
ENDIF()
ENDIF()
IF(LV2_FOUND AND LILV_FOUND)
SET(LMMS_HAVE_LV2 TRUE)
SET(STATUS_LV2 "OK")
ELSE()
SET(STATUS_LV2 "not found, install it or set PKG_CONFIG_PATH appropriately")
ENDIF()
ELSE(WANT_LV2)
SET(STATUS_LV2 "not built as requested")
ENDIF(WANT_LV2)
if(WANT_LV2)
if(PKG_CONFIG_FOUND)
pkg_check_modules(LV2 lv2)
endif()
find_package(Lilv)
if(Lilv_FOUND)
set(LILV_LIBRARIES Lilv::lilv)
endif()
# Ensure both dependencies are found
if(NOT LV2_FOUND)
set(STATUS_LV2 "not found, install lv2 or set PKG_CONFIG_PATH appropriately")
elseif(NOT Lilv_FOUND)
set(STATUS_LV2 "not found, install lilv or set PKG_CONFIG_PATH appropriately")
else()
set(LMMS_HAVE_LV2 TRUE)
set(STATUS_LV2 "OK")
endif()
else()
set(STATUS_LV2 "not built as requested")
endif()
IF(WANT_SUIL)
IF(PKG_CONFIG_FOUND)

View File

@@ -22,7 +22,7 @@ find_path(FluidSynth_INCLUDE_DIR
)
find_library(FluidSynth_LIBRARY
NAMES "fluidsynth"
NAMES "fluidsynth" "fluidsynth-3" "fluidsynth-2" "fluidsynth-1"
HINTS ${FLUIDSYNTH_PKG_LIBRARY_DIRS}
)

View File

@@ -0,0 +1,19 @@
# Copyright (c) 2025 Dalton Messmer <messmer.dalton/at/gmail.com>
#
# Redistribution and use is allowed according to the terms of the New BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
include(ImportedTargetHelpers)
find_package_config_mode_with_fallback(Lilv Lilv::lilv
LIBRARY_NAMES "lilv" "lilv-0"
INCLUDE_NAMES "lilv/lilv.h"
PKG_CONFIG "lilv-0"
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Lilv
REQUIRED_VARS Lilv_LIBRARY Lilv_INCLUDE_DIRS
VERSION_VAR Lilv_VERSION
)

View File

@@ -1,6 +1,6 @@
IF(LMMS_HAVE_LV2)
include_directories(SYSTEM ${LV2_INCLUDE_DIRS})
include_directories(SYSTEM ${LILV_INCLUDE_DIRS})
include_directories(SYSTEM ${Lilv_INCLUDE_DIRS})
include_directories(SYSTEM ${SUIL_INCLUDE_DIRS})
INCLUDE(BuildPlugin)
BUILD_PLUGIN(lv2effect Lv2Effect.cpp Lv2FxControls.cpp Lv2FxControlDialog.cpp Lv2Effect.h Lv2FxControls.h Lv2FxControlDialog.h

View File

@@ -1,6 +1,6 @@
IF(LMMS_HAVE_LV2)
include_directories(SYSTEM ${LV2_INCLUDE_DIRS})
include_directories(SYSTEM ${LILV_INCLUDE_DIRS})
include_directories(SYSTEM ${Lilv_INCLUDE_DIRS})
include_directories(SYSTEM ${SUIL_INCLUDE_DIRS})
INCLUDE(BuildPlugin)
BUILD_PLUGIN(lv2instrument Lv2Instrument.cpp Lv2Instrument.h MOCFILES Lv2Instrument.h EMBEDDED_RESOURCES logo.png)

View File

@@ -60,19 +60,19 @@ include_directories(SYSTEM
${FFTW3F_INCLUDE_DIRS}
)
IF(NOT ("${PULSEAUDIO_INCLUDE_DIR}" STREQUAL ""))
IF(PULSEAUDIO_INCLUDE_DIR)
include_directories(SYSTEM "${PULSEAUDIO_INCLUDE_DIR}")
ENDIF()
IF(NOT ("${LV2_INCLUDE_DIRS}" STREQUAL ""))
IF(LV2_INCLUDE_DIRS)
include_directories(SYSTEM ${LV2_INCLUDE_DIRS})
ENDIF()
IF(NOT ("${LILV_INCLUDE_DIRS}" STREQUAL ""))
include_directories(SYSTEM ${LILV_INCLUDE_DIRS})
IF(Lilv_INCLUDE_DIRS)
include_directories(SYSTEM ${Lilv_INCLUDE_DIRS})
ENDIF()
IF(NOT ("${SUIL_INCLUDE_DIRS}" STREQUAL ""))
IF(SUIL_INCLUDE_DIRS)
include_directories(SYSTEM ${SUIL_INCLUDE_DIRS})
ENDIF()