Enable static builds without vcpkg for linux platforms and strip symbols from the LV2 plugin (#72)
* Building statically without vcpkg * Removed the docker/build scripts, since they're in Travis now
This commit is contained in:
parent
3bfa573dc2
commit
a1af7a0b67
11 changed files with 130 additions and 56 deletions
31
.travis.yml
31
.travis.yml
|
|
@ -1,7 +1,4 @@
|
|||
language: cpp
|
||||
env:
|
||||
global:
|
||||
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}"
|
||||
|
||||
jobs:
|
||||
include:
|
||||
|
|
@ -9,15 +6,19 @@ jobs:
|
|||
env:
|
||||
- CROSS_COMPILE=mingw32
|
||||
- CONTAINER=cross
|
||||
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-mingw32"
|
||||
|
||||
- os: linux
|
||||
env:
|
||||
- CROSS_COMPILE=mingw64
|
||||
- CONTAINER=cross
|
||||
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-mingw64"
|
||||
|
||||
- os: linux
|
||||
arch: amd64
|
||||
dist: bionic
|
||||
env:
|
||||
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
|
|
@ -29,6 +30,30 @@ jobs:
|
|||
- os: linux
|
||||
arch: arm64
|
||||
dist: bionic
|
||||
env:
|
||||
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
|
||||
- os: linux
|
||||
arch: arm64
|
||||
dist: bionic
|
||||
env:
|
||||
- BUILD_TYPE=lv2
|
||||
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}-lv2"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||
|
||||
- os: linux
|
||||
arch: amd64
|
||||
dist: bionic
|
||||
env:
|
||||
- BUILD_TYPE=lv2
|
||||
- INSTALL_DIR="sfizz-${TRAVIS_BRANCH}-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}-lv2"
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
|
|
|
|||
|
|
@ -7,7 +7,11 @@ if [[ ${CROSS_COMPILE} == "mingw32" || ${CROSS_COMPILE} == "mingw64" ]]; then
|
|||
buildenv pacman -Sqy --noconfirm
|
||||
buildenv pacman -Sq --noconfirm base-devel wget mingw-w64-cmake mingw-w64-gcc mingw-w64-pkg-config mingw-w64-libsndfile
|
||||
buildenv i686-w64-mingw32-gcc -v && buildenv i686-w64-mingw32-g++ -v && buildenv i686-w64-mingw32-cmake --version
|
||||
elif [[ ${BUILD_TYPE} == "lv2" ]]; then
|
||||
wget -q https://github.com/sfztools/sndfile-libraries/releases/download/${TRAVIS_OS_NAME}/sndfile-libraries-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}.tar.gz
|
||||
tar xf sndfile-libraries-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}.tar.gz
|
||||
sudo cp -R sndfile-libraries-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}/usr /
|
||||
elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
||||
sudo apt-get install libasound2-dev libjack-jackd2-dev libsndfile1-dev lv2-dev
|
||||
sudo apt-get install libasound2-dev libjack-jackd2-dev libsndfile1-dev
|
||||
gcc -v && g++ -v && cmake --version && /usr/local/bin/cmake --version && $SHELL --version
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -13,13 +13,17 @@ elif [[ ${CROSS_COMPILE} == "mingw64" ]]; then
|
|||
|
||||
buildenv x86_64-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} -DSFIZZ_JACK=OFF ..
|
||||
buildenv make -j
|
||||
elif [[ ${BUILD_TYPE} == "lv2" ]]; then
|
||||
|
||||
buildenv cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} -DSFIZZ_JACK=OFF -DSFIZZ_TESTS=OFF -DSFIZZ_SHARED=OFF -DSFIZZ_STATIC_LIBSNDFILE=ON ..
|
||||
buildenv make -j
|
||||
elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
||||
|
||||
buildenv cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} ..
|
||||
buildenv cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} -DSFIZZ_LV2=OFF -DSFIZZ_TESTS=OFF ..
|
||||
buildenv make -j$(nproc)
|
||||
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
|
||||
|
||||
buildenv cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} ..
|
||||
buildenv cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} -DSFIZZ_TESTS=OFF ..
|
||||
buildenv make -j$(sysctl -n hw.ncpu)
|
||||
|
||||
# Xcode not currently supported, see https://gitlab.kitware.com/cmake/cmake/issues/18088
|
||||
|
|
|
|||
|
|
@ -23,12 +23,14 @@ if (APPLE)
|
|||
link_directories (/usr/local/opt/libsndfile/lib)
|
||||
endif()
|
||||
|
||||
option (ENABLE_LTO "Enable Link Time Optimization [default: ON]" ON)
|
||||
option (SFIZZ_JACK "Enable JACK stand-alone build [default: ON]" ON)
|
||||
option (SFIZZ_LV2 "Enable LV2 plug-in build [default: ON]" ON)
|
||||
option (SFIZZ_BENCHMARKS "Enable benchmarks build [default: OFF]" OFF)
|
||||
option (SFIZZ_TESTS "Enable tests build [default: OFF]" OFF)
|
||||
option (SFIZZ_SHARED "Enable shared library build [default: ON]" ON)
|
||||
option (ENABLE_LTO "Enable Link Time Optimization [default: ON]" ON)
|
||||
option (SFIZZ_JACK "Enable JACK stand-alone build [default: ON]" ON)
|
||||
option (SFIZZ_LV2 "Enable LV2 plug-in build [default: ON]" ON)
|
||||
option (SFIZZ_BENCHMARKS "Enable benchmarks build [default: OFF]" OFF)
|
||||
option (SFIZZ_TESTS "Enable tests build [default: OFF]" OFF)
|
||||
option (SFIZZ_SHARED "Enable shared library build [default: ON]" ON)
|
||||
option (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg [default: OFF]" OFF)
|
||||
option (SFIZZ_STATIC_LIBSNDFILE "Link libsndfile statically [default: OFF]" OFF)
|
||||
|
||||
# Don't use IPO in non Release builds
|
||||
include (CheckIPO)
|
||||
|
|
|
|||
20
appveyor.yml
20
appveyor.yml
|
|
@ -1,8 +1,8 @@
|
|||
version: 0.2.0-{build}
|
||||
version: build-{build}
|
||||
image: Visual Studio 2017
|
||||
configuration: Release
|
||||
platform:
|
||||
#- Win32
|
||||
- Win32
|
||||
- x64
|
||||
|
||||
install:
|
||||
|
|
@ -16,16 +16,20 @@ before_build:
|
|||
- cmd: cd CMakeBuild
|
||||
- cmd: if %platform%==Win32 set CMAKE_GENERATOR=Visual Studio 15 2017
|
||||
- cmd: if %platform%==x64 set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
|
||||
- cmd: cmake .. -G"%CMAKE_GENERATOR%" -DSFIZZ_JACK=OFF -DSFIZZ_BENCHMARKS=OFF -DSFIZZ_TESTS=OFF -DSFIZZ_LV2=ON -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
- cmd: cmake .. -G"%CMAKE_GENERATOR%" -DSFIZZ_JACK=OFF -DSFIZZ_BENCHMARKS=OFF -DSFIZZ_TESTS=OFF -DSFIZZ_LV2=ON -DCMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET=%VCPKG_TRIPLET% -DCMAKE_TOOLCHAIN_FILE=C:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake
|
||||
|
||||
build_script:
|
||||
- cmd: cmake --build . --config Release
|
||||
- cmd: cmake --build . --config Release -j
|
||||
|
||||
after_build:
|
||||
- cmd: cp lv2/Release/sfizz.dll sfizz.lv2/
|
||||
- cmd: 7z a sfizz-%version%-lv2.zip sfizz.lv2
|
||||
- cmd: 7z a sfizz-%version%-library.zip src/Release/sfizz*
|
||||
- cmd: cp sfizz.lv2/Release/sfizz.dll sfizz.lv2/
|
||||
- cmd: rm -rf sfizz.lv2/Release
|
||||
- cmd: if %platform%==Win32 set RELEASE_ARCH=x86
|
||||
- cmd: if %platform%==x64 set RELEASE_ARCH=x64
|
||||
- cmd: 7z a sfizz-%APPVEYOR_REPO_TAG_NAME%-%RELEASE_ARCH%-msvc-lv2.zip sfizz.lv2
|
||||
- cmd: 7z a sfizz-%APPVEYOR_REPO_TAG_NAME%-%RELEASE_ARCH%-msvc-library.zip src/Release/sfizz*
|
||||
|
||||
artifacts:
|
||||
- name: package
|
||||
- name: Packages
|
||||
path: 'CMakeBuild/sfizz*.zip'
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,11 @@ else()
|
|||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(SNDFILE "sndfile" REQUIRED)
|
||||
target_include_directories(sfizz-sndfile INTERFACE ${SNDFILE_INCLUDE_DIRS})
|
||||
target_link_libraries(sfizz-sndfile INTERFACE ${SNDFILE_LIBRARIES})
|
||||
if (SFIZZ_STATIC_LIBSNDFILE)
|
||||
target_link_libraries(sfizz-sndfile INTERFACE ${SNDFILE_STATIC_LIBRARIES})
|
||||
else()
|
||||
target_link_libraries(sfizz-sndfile INTERFACE ${SNDFILE_LIBRARIES})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_library(sfizz-pugixml STATIC "src/external/pugixml/src/pugixml.cpp")
|
||||
|
|
@ -74,6 +78,8 @@ Build JACK stand-alone client: ${SFIZZ_JACK}
|
|||
Build LV2 plug-in: ${SFIZZ_LV2}
|
||||
Build benchmarks: ${SFIZZ_BENCHMARKS}
|
||||
Build tests: ${SFIZZ_TESTS}
|
||||
Use vcpkg: ${SFIZZ_USE_VCPKG}
|
||||
Statically link libsndfile: ${SFIZZ_STATIC_LIBSNDFILE}
|
||||
|
||||
Install prefix: ${CMAKE_INSTALL_PREFIX}
|
||||
LV2 destination directory: ${LV2PLUGIN_INSTALL_DIR}
|
||||
|
|
|
|||
51
innosetup.iss
Normal file
51
innosetup.iss
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
; Script generated by the Inno Script Studio Wizard.
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
|
||||
#define MyAppName "sfizz"
|
||||
#define MyAppVersion "0.1.0"
|
||||
#define MyAppPublisher "sfizz Team"
|
||||
#define MyAppURL "https://sfztools.github.io/sfizz/"
|
||||
#define MyAppExeName "sfizz.exe"
|
||||
|
||||
[Setup]
|
||||
; NOTE: The value of AppId uniquely identifies this application.
|
||||
; Do not use the same AppId value in installers for other applications.
|
||||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
|
||||
AppId={{12B6CCCB-2AE1-49E4-B11E-6BDB2E21FFCA}
|
||||
AppName={#MyAppName}
|
||||
AppVersion={#MyAppVersion}
|
||||
;AppVerName={#MyAppName} {#MyAppVersion}
|
||||
AppPublisher={#MyAppPublisher}
|
||||
AppPublisherURL={#MyAppURL}
|
||||
AppSupportURL={#MyAppURL}
|
||||
AppUpdatesURL={#MyAppURL}
|
||||
DefaultDirName={pf}\{#MyAppName}
|
||||
DefaultGroupName={#MyAppPublisher}
|
||||
OutputBaseFilename=sfizz-setup
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
LicenseFile=setup\LICENSE.txt
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
|
||||
|
||||
[Files]
|
||||
Source: "setup\sfizz.exe"; DestDir: {app}; Flags: ignoreversion
|
||||
Source: "setup\vc_redist.x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall
|
||||
Source: "setup\LICENSE.txt"; DestDir: {app}; Flags: ignoreversion
|
||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||
|
||||
[Run]
|
||||
Filename: {tmp}\vc_redist.x64.exe; \
|
||||
Parameters: "/install /passive /norestart"; \
|
||||
StatusMsg: "Installing Microsoft Visual C++ 2015-2019 Redistributable (x64)..."
|
||||
Filename: {app}\{#MyAppExeName}; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
|
||||
|
|
@ -11,8 +11,15 @@ set (LV2PLUGIN_TTL_SRC_FILES
|
|||
manifest.ttl.in
|
||||
${PROJECT_NAME}.ttl.in
|
||||
)
|
||||
add_library (${LV2PLUGIN_PRJ_NAME} SHARED ${PROJECT_NAME}.c ${LV2PLUGIN_TTL_SRC_FILES})
|
||||
add_library (${LV2PLUGIN_PRJ_NAME} MODULE ${PROJECT_NAME}.c ${LV2PLUGIN_TTL_SRC_FILES})
|
||||
target_link_libraries (${LV2PLUGIN_PRJ_NAME} ${PROJECT_NAME}::${PROJECT_NAME})
|
||||
# Explicitely strip all symbols on Linux but lv2_descriptor()
|
||||
# MacOS linker does not support this apparently https://bugs.webkit.org/show_bug.cgi?id=144555
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
file(COPY lv2.version DESTINATION ${CMAKE_BINARY_DIR}/lv2)
|
||||
target_link_libraries(${LV2PLUGIN_PRJ_NAME} "-Wl,--version-script=lv2.version")
|
||||
# target_link_libraries(${LV2PLUGIN_PRJ_NAME} "-Wl,-u,lv2_descriptor")
|
||||
endif()
|
||||
target_include_directories(${LV2PLUGIN_PRJ_NAME} PRIVATE . external/ardour)
|
||||
sfizz_enable_lto_if_needed (${LV2PLUGIN_PRJ_NAME})
|
||||
|
||||
|
|
@ -29,7 +36,7 @@ file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR})
|
|||
configure_file (manifest.ttl.in ${PROJECT_BINARY_DIR}/manifest.ttl)
|
||||
configure_file (${PROJECT_NAME}.ttl.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.ttl)
|
||||
configure_file (LICENSE.md.in ${PROJECT_BINARY_DIR}/LICENSE.md)
|
||||
if (SFIZZ_USE_VCPKG)
|
||||
if (SFIZZ_USE_VCPKG OR SFIZZ_STATIC_LIBSNDFILE OR CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||
file(COPY "lgpl-3.0.txt" DESTINATION ${PROJECT_BINARY_DIR})
|
||||
endif()
|
||||
|
||||
|
|
|
|||
4
lv2/lv2.version
Normal file
4
lv2/lv2.version
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
LV2ABI_1.0 {
|
||||
global: *lv2_descriptor*;
|
||||
local: *;
|
||||
};
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
FROM ubuntu:latest
|
||||
|
||||
RUN apt-get update && apt-get -y install git g++ curl unzip tar apt-transport-https ca-certificates gnupg software-properties-common wget
|
||||
|
||||
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add - \
|
||||
&& apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y cmake
|
||||
|
||||
RUN cd /tmp \
|
||||
&& git clone https://github.com/Microsoft/vcpkg.git \
|
||||
&& cd vcpkg \
|
||||
&& ./bootstrap-vcpkg.sh -disableMetrics \
|
||||
&& ./vcpkg integrate install
|
||||
|
||||
COPY x64-linux-hidden.cmake .
|
||||
|
||||
RUN /tmp/vcpkg/vcpkg --overlay-triplets=. install libsndfile:x64-linux-hidden benchmark:x64-linux-hidden
|
||||
|
||||
ADD https://api.github.com/repos/sfztools/sfizz/git/refs/heads/master version.json
|
||||
RUN cd /tmp \
|
||||
&& git clone --branch master --recursive https://github.com/sfztools/sfizz.git \
|
||||
&& cd sfizz \
|
||||
&& mkdir build \
|
||||
&& cd build \
|
||||
&& cmake .. -DSFIZZ_JACK=OFF -DSFIZZ_SHARED=OFF "-DCMAKE_TOOLCHAIN_FILE=/tmp/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-linux-hidden -DCMAKE_BUILD_TYPE=Release -DSFIZZ_USE_VCPKG=ON\
|
||||
&& make -j 16
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
script_dir="$(dirname "$0")"
|
||||
pushd $script_dir
|
||||
docker build -t sfizz .
|
||||
popd
|
||||
docker cp $(docker create sfizz:latest):/tmp/sfizz/build/sfizz.lv2 .
|
||||
Loading…
Add table
Reference in a new issue