diff --git a/.travis.yml b/.travis.yml index d4d70990..12988993 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,11 @@ language: cpp matrix: include: - os: linux - dist: xenial + dist: bionic addons: apt: sources: - - ubuntu-toolchain-r-test + - sourceline: 'ppa:ubuntu-toolchain-r/test' packages: - gcc-8 - g++-8 diff --git a/.travis/after_success.sh b/.travis/after_success.sh index 783f99c4..d9dafabc 100755 --- a/.travis/after_success.sh +++ b/.travis/after_success.sh @@ -8,18 +8,4 @@ chmod +x send.sh ./send.sh success $WEBHOOK_URL # Deploy -export VERSION=$(git describe --tags) -if [ "$TRAVIS_OS_NAME" = "linux" ]; then - export DEPLOYFILE=Sfizz-$VERSION-x86_64.AppImage - wget -c -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" - chmod +x linuxdeploy-x86_64.AppImage - for size in 16 32 48 128 256; do dirname="sfizz/usr/share/icons/hicolor/${size}x${size}/apps"; mkdir -p $dirname; cp ./resources/icons/icon_${size}px.png ./${dirname}/sfizz.png; done - ./linuxdeploy-x86_64.AppImage --appdir=sfizz --desktop-file=./resources/linux/sfizz.desktop --executable=./build/clients/sfizz_jack --output=appimage -elif [ "$TRAVIS_OS_NAME" = "osx" ]; then - export DEPLOYFILE=sfizz-$VERSION.dmg - mkdir ./output - cp -r /build/* ./output/ - cp ./resources/icons/icon.icns ./output/sfizz.app/Contents/Resources/ - hdiutil create /tmp/tmp.dmg -ov -volname "sfizz-$VERSION" -fs HFS+ -srcfolder "./output/" - hdiutil convert /tmp/tmp.dmg -format UDZO -o ./$DEPLOYFILE; -fi +./deploy.sh diff --git a/.travis/deploy.sh b/.travis/deploy.sh new file mode 100755 index 00000000..8acde8a9 --- /dev/null +++ b/.travis/deploy.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +export VERSION=$(git describe --tags) +if [ "$TRAVIS_OS_NAME" = "linux" ]; then + export DEPLOYFILE=Sfizz-$VERSION-x86_64.AppImage + wget -c -nv "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage" + chmod +x linuxdeploy-x86_64.AppImage + for size in 16 32 48 128 256; do dirname="sfizz/usr/share/icons/hicolor/${size}x${size}/apps"; mkdir -p $dirname; cp ./resources/icons/icon_${size}px.png ./${dirname}/sfizz.png; done + ./linuxdeploy-x86_64.AppImage --appdir=sfizz --desktop-file=./resources/linux/sfizz.desktop --executable=./build/clients/sfizz_jack --output=appimage +elif [ "$TRAVIS_OS_NAME" = "osx" ]; then + export DEPLOYFILE=sfizz-$VERSION.dmg + mkdir ./output + cp -r /build/* ./output/ + cp ./resources/icons/icon.icns ./output/sfizz.app/Contents/Resources/ + hdiutil create /tmp/tmp.dmg -ov -volname "sfizz-$VERSION" -fs HFS+ -srcfolder "./output/" + hdiutil convert /tmp/tmp.dmg -format UDZO -o ./$DEPLOYFILE; +fi diff --git a/.travis/script.sh b/.travis/script.sh index 96174a47..bdd57a4a 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -7,7 +7,9 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then gcc -v && g++ -v && cmake --version && /usr/local/bin/cmake --version && $SHELL --version mkdir build && cd build - /usr/local/bin/cmake .. + + # FIXME: lto error in build when enabled + /usr/local/bin/cmake -D CMAKE_BUILD_TYPE=Release -D ENABLE_LTO=OFF .. make -j$(nproc) elif [ "$TRAVIS_OS_NAME" = "osx" ]; then mkdir build && cd build diff --git a/cmake/CheckIPO.cmake b/cmake/CheckIPO.cmake index c110276f..d25c1f10 100644 --- a/cmake/CheckIPO.cmake +++ b/cmake/CheckIPO.cmake @@ -8,13 +8,13 @@ else() if (${output}) message (WARNING "\nIPO disabled: ${output}") else() - message (WARNING "\nIPO was disabled, not in a Release build?") + message (WARNING "\nIPO was disabled or not in a Release build.") endif() set (ENABLE_LTO OFF) endif() function (SFIZZ_ENABLE_LTO_IF_NEEDED TARGET) - if (ENABLE_LTO) + if (${ENABLE_LTO}) message(STATUS "Enabling LTO on ${TARGET}") set_property (TARGET ${TARGET} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() diff --git a/lv2/CMakeLists.txt b/lv2/CMakeLists.txt index 84f1dbee..7cc07397 100644 --- a/lv2/CMakeLists.txt +++ b/lv2/CMakeLists.txt @@ -1,9 +1,5 @@ project (lv2plugin) -# Dependencies check -find_package (PkgConfig) -pkg_check_modules (LV2 lv2>=1.10.0 REQUIRED) - # CMAKE_PROJECT_NAME is the top level project name, not the current one set (LV2PLUGIN_PRJ_NAME "${CMAKE_PROJECT_NAME}_lv2") @@ -27,9 +23,22 @@ set (LV2PLUGIN_TTL_SRC_FILES ${CMAKE_PROJECT_NAME}.ttl.in ) add_library (${LV2PLUGIN_PRJ_NAME} SHARED ${CMAKE_PROJECT_NAME}.c ${LV2PLUGIN_TTL_SRC_FILES}) -target_include_directories (${LV2PLUGIN_PRJ_NAME} PRIVATE ${LV2_INCLUDE_DIRS}) target_link_libraries (${LV2PLUGIN_PRJ_NAME} ${CMAKE_PROJECT_NAME}::${CMAKE_PROJECT_NAME}) +# Fetch required LV2 include files +include(FetchContent) +FetchContent_Declare( + lv2 + GIT_REPOSITORY https://gitlab.com/lv2/lv2.git + GIT_TAG v1.16.0 +) +FetchContent_GetProperties(lv2) +if(NOT lv2_POPULATED) + FetchContent_Populate(lv2) + target_include_directories(${LV2PLUGIN_PRJ_NAME} PRIVATE ${lv2_SOURCE_DIR}) +endif() + +# Enable LTO if available if (ENABLE_LTO) set_property (TARGET ${LV2PLUGIN_PRJ_NAME} PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() diff --git a/lv2/sfizz.c b/lv2/sfizz.c index 2d41624a..87c09234 100644 --- a/lv2/sfizz.c +++ b/lv2/sfizz.c @@ -25,20 +25,20 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include