mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 16:50:26 +02:00
Refactor build and CI configurations
Reword vcpkg caching comment Make comment about wxwidgets Linux/macOS workaround more clear Give each step of `cmake_build.yml` workflow a unique ID Change cache lookups to use step's id instead of step's name Add glob protection to runner OS detection in CI Set new default CI build type of MinSizeRel Ensure consistent formatting across `CMakeLists.txt` files Change mimetypes generated on Linux to use tenacity-project mimetype Add more explanatory comments to both `CMakeLists.txt` Replace improper build architecture debug messages Signed-off-by: Emily Mabrey <emabrey@tenacityaudio.org>
This commit is contained in:
parent
b650b5aafc
commit
c3db577e93
319
.github/workflows/cmake_build.yml
vendored
319
.github/workflows/cmake_build.yml
vendored
@ -18,70 +18,94 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Matrix id format: {os}-{osname}-{osversion}-{arch}-{triplet}-{generator(_platform)}
|
||||
# Replace - with _
|
||||
# Remove .
|
||||
config:
|
||||
|
||||
- name: Ubuntu_20.04
|
||||
- name: Linux - Ubuntu 20.04 (x86_64) - Ninja
|
||||
id: linux-ubuntu-2004-x86_64-x64_linux-ninja
|
||||
os: ubuntu-20.04
|
||||
arch: x86_64 # as reported by `arch` or `uname -m`
|
||||
compiler_cache: ccache
|
||||
compiler_cache_path: ~/.ccache
|
||||
vcpkg_binary_cache: ~/.cache/vcpkg
|
||||
arch: x86_64
|
||||
vcpkg_triplet: x64-linux
|
||||
wxwidgets_git_url: https://github.com/wxWidgets/wxWidgets.git
|
||||
wxwidgets_git_ref: v3.1.5
|
||||
WX_CONFIG: /home/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
- name: macOS_Intel
|
||||
os: macos-latest
|
||||
arch: Intel # as reported by Apple menu > About This Mac
|
||||
compiler_cache: ccache
|
||||
compiler_cache_path: ~/Library/Caches/ccache
|
||||
vcpkg_binary_cache: ~/.cache/vcpkg
|
||||
- name: macOS - Big Sur 11 (Intel) - Ninja
|
||||
id: macos-bigsur-1100-intel-x64_osx_1012min-ninja
|
||||
os: macos-11
|
||||
arch: Intel
|
||||
vcpkg_triplet: x64-osx-10.12min
|
||||
wxwidgets_git_url: https://github.com/wxWidgets/wxWidgets.git
|
||||
wxwidgets_git_ref: v3.1.5
|
||||
WX_CONFIG: /Users/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
- name: Windows_32bit
|
||||
os: windows-latest
|
||||
arch: x86
|
||||
# required so CMake uses MSVC rather than MinGW
|
||||
cc: cl
|
||||
cxx: cl
|
||||
compiler_cache: sccache
|
||||
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
|
||||
vcpkg_binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg
|
||||
vcpkg_triplet: x86-windows
|
||||
exe_suffix: .exe
|
||||
- name: macOS - Catalina 10.15 (Intel) - Ninja
|
||||
id: macos-catalina-1015-intel-x64_osx_1012min-ninja
|
||||
os: macos-10.15
|
||||
arch: Intel
|
||||
vcpkg_triplet: x64-osx-10.12min
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
- name: Windows_64bit
|
||||
os: windows-latest
|
||||
- name: Windows - Server 2019 (amd64) - Visual Studio 2019
|
||||
id: windows-server-2019-amd64-x64_windows-vs2019_x64
|
||||
os: windows-2019
|
||||
arch: amd64
|
||||
# required so CMake uses MSVC rather than MinGW
|
||||
cc: cl
|
||||
cxx: cl
|
||||
compiler_cache: sccache
|
||||
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
|
||||
vcpkg_binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg
|
||||
vcpkg_triplet: x64-windows
|
||||
exe_suffix: .exe
|
||||
CMAKE_GENERATOR: Visual Studio 16 2019
|
||||
CMAKE_GENERATOR_PLATFORM: x64
|
||||
|
||||
- name: Windows - Server 2019 (win32) - Visual Studio 2019
|
||||
id: windows-server-2019-x86-x86_windows-vs2019_win32
|
||||
os: windows-2019
|
||||
arch: x86
|
||||
vcpkg_triplet: x86-windows
|
||||
CMAKE_GENERATOR: Visual Studio 16 2019
|
||||
CMAKE_GENERATOR_PLATFORM: win32
|
||||
|
||||
- name: Windows - Server 2019 (amd64) - Ninja
|
||||
id: windows-server-2019-amd64-x64_windows-ninja
|
||||
os: windows-2019
|
||||
arch: amd64
|
||||
vcpkg_triplet: x64-windows
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
- name: Windows - Server 2019 (win32) - Ninja
|
||||
id: windows-server-2019-x86-x86_windows-ninja
|
||||
os: windows-2019
|
||||
arch: x86
|
||||
vcpkg_triplet: x86-windows
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
|
||||
env:
|
||||
CMAKE_BUILD_TYPE: RelWithDebInfo
|
||||
CMAKE_C_COMPILER_LAUNCHER: ${{ matrix.config.os.compiler_cache }}
|
||||
CMAKE_CXX_COMPILER_LAUNCHER: ${{ matrix.config.os.compiler_cache }}
|
||||
|
||||
AUDACITY_ARCH_LABEL: ${{ matrix.config.arch }}
|
||||
MACOSX_DEPLOYMENT_TARGET: 10.12
|
||||
|
||||
# CMake settings
|
||||
CMAKE_BUILD_TYPE: MinSizeRel
|
||||
CMAKE_GENERATOR: ${{matrix.config.CMAKE_GENERATOR}}
|
||||
CMAKE_GENERATOR_PLATFORM: ${{matrix.config.CMAKE_GENERATOR_PLATFORM}}
|
||||
|
||||
# vcpkg settings
|
||||
VCPKG_DISABLE_METRICS: true
|
||||
VCPKG_DEFAULT_TRIPLET: ${{ matrix.config.vcpkg_triplet }}
|
||||
VCPKG_BINARY_SOURCES: "clear;default,readwrite;nuget,https://tenacityteam.jfrog.io/artifactory/api/nuget/tenacity-nuget,readwrite"
|
||||
|
||||
# Artifactory cache settings
|
||||
JFROG_ARTIFACTORY_NUGET_USER: ${{secrets.JFROG_ARTIFACTORY_NUGET_USER}}
|
||||
JFROG_ARTIFACTORY_NUGET_PASS: ${{secrets.JFROG_ARTIFACTORY_NUGET_PASS}}
|
||||
JFROG_ARTIFACTORY_NUGET_TOKEN: ${{secrets.JFROG_ARTIFACTORY_NUGET_TOKEN}}
|
||||
|
||||
# Apple codesigning
|
||||
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
|
||||
APPLE_NOTARIZATION_USER_NAME: ${{ secrets.APPLE_NOTARIZATION_USER_NAME }}
|
||||
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
|
||||
|
||||
# Windows codesigning
|
||||
# This variables will be used by all the steps
|
||||
WINDOWS_CERTIFICATE: ${{ secrets.WINDOWS_CERTIFICATE }}
|
||||
WINDOWS_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
|
||||
|
||||
AUDACITY_ARCH_LABEL: ${{ matrix.config.arch }}
|
||||
# WxWidgets info for Linux and macOS builds
|
||||
WX_GIT_URL: https://github.com/wxWidgets/wxWidgets.git
|
||||
WX_GIT_REF: v3.1.5
|
||||
|
||||
steps:
|
||||
|
||||
@ -90,22 +114,63 @@ jobs:
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Get Git commit of vcpkg submodule
|
||||
run: echo VCPKG_COMMIT=$(git ls-tree HEAD vcpkg | awk '{print $3}') >> ${GITHUB_ENV}
|
||||
|
||||
- name: Setup platform specific environmental variables
|
||||
run: |
|
||||
if [[ "${{runner.os}}" == "Windows" ]]; then
|
||||
echo "Using Windows specific env vars"
|
||||
echo COMPILER_CACHE_PATH=C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache >> ${GITHUB_ENV}
|
||||
echo COMPILER_CACHE=sccache >> ${GITHUB_ENV}
|
||||
echo EXE_SUFFIX=.exe >> ${GITHUB_ENV}
|
||||
echo VCPKG_CACHE_PATH=C:\Users\runneradmin\AppData\Local\vcpkg >> ${GITHUB_ENV}
|
||||
echo CMAKE_C_COMPILER_LAUNCHER=sccache >> ${GITHUB_ENV}
|
||||
echo CMAKE_CXX_COMPILER_LAUNCHER=sccache >> ${GITHUB_ENV}
|
||||
if [[ "${{ env.CMAKE_GENERATOR }}" == "Ninja" ]]; then
|
||||
echo CC=cl >> ${GITHUB_ENV}
|
||||
echo CXX=cl >> ${GITHUB_ENV}
|
||||
fi
|
||||
else
|
||||
echo "Using non-Windows env vars"
|
||||
echo COMPILER_CACHE_PATH= ~/Library/Caches/ccache >> ${GITHUB_ENV}
|
||||
echo COMPILER_CACHE=ccache >> ${GITHUB_ENV}
|
||||
echo EXE_SUFFIX= >> ${GITHUB_ENV}
|
||||
echo VCPKG_CACHE_PATH=~/.cache/vcpkg >> ${GITHUB_ENV}
|
||||
echo CMAKE_C_COMPILER_LAUNCHER=ccache >> ${GITHUB_ENV}
|
||||
echo CMAKE_CXX_COMPILER_LAUNCHER=ccache >> ${GITHUB_ENV}
|
||||
if [[ "${{runner.os}}" == "Linux" ]]; then
|
||||
echo WX_INSTALL_DIR=/home/runner/work/tenacity/tenacity/wxwidgets-install >> ${GITHUB_ENV}
|
||||
echo WX_CONFIG=/home/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config >> ${GITHUB_ENV}
|
||||
else
|
||||
echo WX_INSTALL_DIR=/Users/runner/work/tenacity/tenacity/wxwidgets-install >> ${GITHUB_ENV}
|
||||
echo WX_CONFIG=/Users/runner/work/tenacity/tenacity/wxwidgets-install/bin/wx-config >> ${GITHUB_ENV}
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: "[macOS] Install Apple codesigning certificates"
|
||||
uses: apple-actions/import-codesign-certs@v1
|
||||
if: startswith( matrix.config.os, 'macos' ) && github.repository_owner == 'tenacityteam' && github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
|
||||
- name: "[Windows] Set up MSVC Developer Command Prompt"
|
||||
if: runner.os == 'Windows'
|
||||
uses: seanmiddleditch/gha-setup-vsdevenv@v3
|
||||
with:
|
||||
arch: ${{ matrix.config.arch }}
|
||||
|
||||
- name: Install Nuget
|
||||
uses: nuget/setup-nuget@v1
|
||||
with:
|
||||
# Nuget versions needs to be the same version that vcpkg expects
|
||||
# So update them in parallel
|
||||
nuget-version: 5.10.0
|
||||
|
||||
- name: Authenticate CI to Artifactory
|
||||
- name: "[On Push] Authenticate CI to Artifactory"
|
||||
if: github.event_name == 'push' && github.repository_owner == 'tenacityteam'
|
||||
run: |
|
||||
nuget sources Add -Name Artifactory -Source https://tenacityteam.jfrog.io/artifactory/api/nuget/tenacity-nuget -username ${JFROG_ARTIFACTORY_NUGET_USER} -password ${JFROG_ARTIFACTORY_NUGET_PASS} -ForceEnglishOutput -NonInteractive
|
||||
nuget setapikey ${JFROG_ARTIFACTORY_NUGET_USER}:${JFROG_ARTIFACTORY_NUGET_TOKEN} -Source Artifactory -ForceEnglishOutput -NonInteractive
|
||||
env:
|
||||
JFROG_ARTIFACTORY_NUGET_USER: ${{secrets.JFROG_ARTIFACTORY_NUGET_USER}}
|
||||
JFROG_ARTIFACTORY_NUGET_PASS: ${{secrets.JFROG_ARTIFACTORY_NUGET_PASS}}
|
||||
JFROG_ARTIFACTORY_NUGET_TOKEN: ${{secrets.JFROG_ARTIFACTORY_NUGET_TOKEN}}
|
||||
|
||||
- name: "[Linux] Install dependencies"
|
||||
if: runner.os == 'Linux'
|
||||
@ -127,7 +192,6 @@ jobs:
|
||||
libgtk-3-dev
|
||||
libsuil-dev
|
||||
gettext
|
||||
|
||||
- name: "[MacOS] Install dependencies"
|
||||
if: runner.os == 'macOS'
|
||||
run: >-
|
||||
@ -136,7 +200,6 @@ jobs:
|
||||
ccache
|
||||
ninja
|
||||
nasm
|
||||
|
||||
- name: "[Windows] Install dependencies"
|
||||
if: runner.os == 'Windows'
|
||||
shell: pwsh
|
||||
@ -148,126 +211,90 @@ jobs:
|
||||
iwr -useb get.scoop.sh | iex
|
||||
scoop install sccache
|
||||
|
||||
- name: Install Apple codesigning certificates
|
||||
uses: apple-actions/import-codesign-certs@v1
|
||||
if: startswith( matrix.config.os, 'macos' ) && github.repository_owner == 'tenacityteam' && github.event_name == 'create' && github.event.ref_type == 'tag'
|
||||
with:
|
||||
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
|
||||
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
|
||||
|
||||
# required for CMake to find Ninja
|
||||
- name: "[Windows] Set up MSVC Developer Command Prompt"
|
||||
if: runner.os == 'Windows'
|
||||
uses: seanmiddleditch/gha-setup-vsdevenv@v3
|
||||
with:
|
||||
arch: ${{ matrix.config.arch }}
|
||||
|
||||
- name: Get Git commit of vcpkg submodule
|
||||
run: echo VCPKG_COMMIT=$(git ls-tree HEAD vcpkg | awk '{print $3}') >> ${GITHUB_ENV}
|
||||
|
||||
# Cache the vcpkg cache and the vcpkg executable to avoid bootstrapping each time
|
||||
- name: Setup vcpkg cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
# cache the vcpkg executable to avoid having to bootstrap vcpkg every time
|
||||
path: |
|
||||
${{ github.workspace }}/vcpkg/vcpkg${{ matrix.config.exe_suffix }}
|
||||
${{ matrix.config.vcpkg_binary_cache }}
|
||||
key: ${{ matrix.config.name }}-${{ hashFiles('**/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}-${{ github.run_number }}
|
||||
${{ github.workspace }}/vcpkg/vcpkg${{ env.EXE_SUFFIX }}
|
||||
${{ env.VCPKG_CACHE_PATH }}
|
||||
key: ${{ matrix.config.id }}-${{ hashFiles('**/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}-${{ github.run_number }}
|
||||
restore-keys: |
|
||||
${{ matrix.config.name }}-${{ hashFiles(' **/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}-
|
||||
${{ matrix.config.name }}-${{ hashFiles(' **/vcpkg.json') }}-
|
||||
${{ matrix.config.name }}-
|
||||
${{ matrix.config.id }}-${{ hashFiles(' **/vcpkg.json') }}-${{ env.VCPKG_COMMIT }}-
|
||||
${{ matrix.config.id }}-${{ hashFiles(' **/vcpkg.json') }}-
|
||||
${{ matrix.config.id }}-
|
||||
|
||||
- name: "[Linux/macOS] Set up wxWidgets cache"
|
||||
uses: actions/cache@v2
|
||||
id: wxwidgets-cache
|
||||
if: runner.os != 'Windows'
|
||||
with:
|
||||
path: ${{ env.WX_INSTALL_DIR }}
|
||||
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ env.WX_GIT_URL }}-${{ env.WX_GIT_REF }}
|
||||
|
||||
# FIXME: use wxWidgets from vcpkg for all OSes when bugs are fixed for Linux and macOS
|
||||
# https://github.com/microsoft/vcpkg/pull/17111
|
||||
- name: "[Linux/macOS] Build and install wxWidgets"
|
||||
if: steps.wxwidgets-cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
|
||||
run: |
|
||||
# wxWidgets' build system does not find dependencies from vcpkg, so use its vendored Git submodules
|
||||
git clone --recurse-submodules ${{ env.WX_GIT_URL }}
|
||||
cd wxWidgets
|
||||
git checkout ${{ env.WX_GIT_REF }}
|
||||
cmake -S . -B cmake_build -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -D CMAKE_INSTALL_PREFIX=${{ env.WX_INSTALL_DIR }}
|
||||
cmake --build cmake_build
|
||||
cmake --install cmake_build
|
||||
|
||||
- name: Set up compiler cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ env.COMPILER_CACHE_PATH }}
|
||||
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-${{ github.run_number }}
|
||||
restore-keys: |
|
||||
${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-
|
||||
${{ matrix.config.os }}-${{ matrix.config.arch }}-
|
||||
|
||||
# FIXME: hack around bad SSL certificate, needed to build ffmpeg
|
||||
# https://github.com/microsoft/vcpkg/issues/19121
|
||||
- name: "[Windows] Install yasm"
|
||||
if: runner.os == 'Windows'
|
||||
run: |
|
||||
mkdir -p "vcpkg/downloads/tools/yasm/1.3.0.6"
|
||||
curl -k -o "vcpkg/downloads/tools/yasm/1.3.0.6/yasm.exe" \
|
||||
"http://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe"
|
||||
|
||||
- name: "Set up wxwidgets cache"
|
||||
uses: actions/cache@v2
|
||||
id: wxwidgets-cache
|
||||
if: runner.os != 'Windows'
|
||||
with:
|
||||
path: ${{ github.workspace }}/wxwidgets-install
|
||||
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.wxwidgets_git_url }}-${{ matrix.config.wxwidgets_git_ref }}
|
||||
|
||||
# FIXME: use wxWidgets from vcpkg for all OSes when bugs are fixed for Linux and macOS
|
||||
# https://github.com/microsoft/vcpkg/pull/17111
|
||||
- name: Build and install wxWidgets
|
||||
if: steps.wxwidgets-cache.outputs.cache-hit != 'true' && runner.os != 'Windows'
|
||||
run: |
|
||||
# wxWidgets' build system does not find dependencies from vcpkg, so use its vendored Git submodules
|
||||
git clone --recurse-submodules ${{ matrix.config.wxwidgets_git_url }}
|
||||
cd wxWidgets
|
||||
git checkout ${{ matrix.config.wxwidgets_git_ref }}
|
||||
cmake -G Ninja -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/wxwidgets-install \
|
||||
-S . -B cmake_build
|
||||
cmake --build cmake_build
|
||||
cmake --install cmake_build
|
||||
|
||||
- name: "Set up compiler cache"
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ matrix.config.compiler_cache_path }}
|
||||
key: ${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-${{ github.run_number }}
|
||||
restore-keys: |
|
||||
${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ github.head_ref }}-
|
||||
${{ matrix.config.os }}-${{ matrix.config.arch }}-
|
||||
mkdir -p "${YASM_OUTPUT_DIR}"
|
||||
curl -k -o "${YASM_OUTPUT_DIR}/yasm.exe" "http://www.tortall.net/projects/yasm/snapshots/v1.3.0.6.g1962/yasm-1.3.0.6.g1962.exe"
|
||||
env:
|
||||
YASM_OUTPUT_DIR: vcpkg/downloads/tools/yasm/1.3.0.6
|
||||
|
||||
- name: Configure
|
||||
run: >-
|
||||
cmake
|
||||
-G Ninja
|
||||
-D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }}
|
||||
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install
|
||||
-D VCPKG=ON
|
||||
-S .
|
||||
-B build
|
||||
env:
|
||||
# Apple code signing
|
||||
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
|
||||
APPLE_NOTARIZATION_USER_NAME: ${{ secrets.APPLE_NOTARIZATION_USER_NAME }}
|
||||
APPLE_NOTARIZATION_PASSWORD: ${{ secrets.APPLE_NOTARIZATION_PASSWORD }}
|
||||
CC: ${{ matrix.config.cc }}
|
||||
CXX: ${{ matrix.config.cxx }}
|
||||
# hack to get CMake to find wxWidgets until vcpkg wxWidgets port is fixed
|
||||
# https://github.com/microsoft/vcpkg/pull/17111
|
||||
WX_CONFIG: ${{ matrix.config.WX_CONFIG }}
|
||||
run: cmake -B build -D VCPKG=ON -D CMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/build/install
|
||||
|
||||
- name: Build
|
||||
run: cmake --build build --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
|
||||
|
||||
- name: "Print compiler cache stats"
|
||||
run: ${{ matrix.config.compiler_cache }} -s
|
||||
- name: Print compiler cache stats
|
||||
run: ${{ env.COMPILER_CACHE}} -s
|
||||
|
||||
- name: Install
|
||||
run: cmake --install build --config ${{ env.CMAKE_BUILD_TYPE }} --verbose
|
||||
|
||||
- name: "[Windows] Package"
|
||||
if: runner.os == 'Windows'
|
||||
run: cmake --build build --target innosetup --config ${{ env.CMAKE_BUILD_TYPE }}
|
||||
|
||||
- name: "[Ubuntu/macOS] Package"
|
||||
if: runner.os != 'Windows'
|
||||
working-directory: build
|
||||
run: >-
|
||||
cpack
|
||||
-C ${{ env.CMAKE_BUILD_TYPE }}
|
||||
-D CPACK_COMMAND_HDIUTIL=${{ github.workspace }}/scripts/ci/macos/repeat_hdiutil.sh
|
||||
--verbose
|
||||
&& rm -r package/_CPack_Packages
|
||||
- name: Package
|
||||
run: |
|
||||
if [[ "${{runner.os}}" == "Windows" ]]; then
|
||||
cmake --build build --target innosetup --config ${{ env.CMAKE_BUILD_TYPE }}
|
||||
else
|
||||
cd build
|
||||
cpack -C ${{ env.CMAKE_BUILD_TYPE }} -D CPACK_COMMAND_HDIUTIL=${{ env.CPACK_COMMAND_HDIUTIL }} --verbose
|
||||
rm -r package/_CPack_Packages
|
||||
fi
|
||||
env:
|
||||
# Required for linuxdeploy to find wxWidgets libraries installed without a package manager
|
||||
WXWIDGETS_LD_LIBRARY_PATH: ${{ github.workspace }}/wxwidgets-install/lib
|
||||
# Workaround for CPack hdiutil/ finder service race condition bug
|
||||
CPACK_COMMAND_HDIUTIL: ${{ github.workspace }}/scripts/ci/macos/repeat_hdiutil.sh
|
||||
# Required on Linux to find wxWidgets libraries installed without a package manager
|
||||
WXWIDGETS_LD_LIBRARY_PATH: ${{ env.WX_INSTALL_DIR }}/lib
|
||||
|
||||
- name: Upload package artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Tenacity_${{ matrix.config.name }}_${{ github.run_id }}_${{ env.GIT_HASH_SHORT }}
|
||||
name: Tenacity_${{ matrix.config.id }}_${{ github.run_id }}_${{ env.GIT_HASH_SHORT }}
|
||||
path: build/package/*
|
||||
if-no-files-found: error
|
||||
|
||||
|
1033
CMakeLists.txt
1033
CMakeLists.txt
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,3 @@
|
||||
|
||||
set( TARGET Tenacity )
|
||||
set( TARGET_ROOT ${CMAKE_SOURCE_DIR}/src )
|
||||
|
||||
@ -14,19 +13,23 @@ add_dependencies( ${TARGET} plug-ins )
|
||||
|
||||
def_vars()
|
||||
|
||||
# Add a target that will provide the git revision info
|
||||
# whenever it changes. (Must be done at build time, not
|
||||
# configuration time.)
|
||||
if( NOT GIT_FOUND )
|
||||
find_package( Git )
|
||||
endif()
|
||||
|
||||
# ~~~
|
||||
# Add a target that will provide the git revision info whenever it changes.
|
||||
# Must be done at build time, not configuration time.
|
||||
# ~~~
|
||||
if( GIT_FOUND )
|
||||
add_custom_target(
|
||||
version
|
||||
add_custom_target( version
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -D GIT="${GIT_EXECUTABLE}"
|
||||
${CMAKE_COMMAND}
|
||||
-D GIT="${GIT_EXECUTABLE}"
|
||||
-D GIT_DESCRIBE="${GIT_DESCRIBE}"
|
||||
-D "_PRVDIR=${_PRVDIR}"
|
||||
-P "cmake-proxies/cmake-modules/Version.cmake"
|
||||
WORKING_DIRECTORY
|
||||
${CMAKE_SOURCE_DIR}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_dependencies( ${TARGET} version )
|
||||
@ -34,46 +37,34 @@ endif()
|
||||
|
||||
# Handle Audio Units option
|
||||
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
cmd_option(
|
||||
${_OPT}use_audio_units
|
||||
"Use Audio Units plug-in support [on, off]"
|
||||
ON
|
||||
)
|
||||
set( USE_AUDIO_UNITS ${${_OPT}use_audio_units} CACHE INTERNAL "" )
|
||||
cmd_option( use_audio_units "Use Audio Units plug-in support [ON, OFF]" ON )
|
||||
set( USE_AUDIO_UNITS ${use_audio_units} CACHE INTERNAL "" )
|
||||
endif()
|
||||
|
||||
# Detect, which version of FileDialog to use for
|
||||
# We always assume that GTK is used on platforms other than Windows and macOS,
|
||||
# as there is no other implementation avalaible now
|
||||
# ~~~
|
||||
# Detect, which version of FileDialog to use
|
||||
# Assume that GTK is used on platforms other than Windows or macOS
|
||||
# ~~~
|
||||
if( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
set( wxIS_MAC on )
|
||||
set( wxIS_MAC ON )
|
||||
elseif( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
||||
set ( wxIS_WIN on )
|
||||
set( wxIS_WIN ON )
|
||||
else()
|
||||
set ( wxIS_GTK on)
|
||||
set( wxIS_GTK ON )
|
||||
endif()
|
||||
|
||||
# Handle Ladspa option
|
||||
cmd_option(
|
||||
${_OPT}use_ladspa
|
||||
"Use LADSPA plug-in support [on, off]"
|
||||
ON
|
||||
)
|
||||
set( USE_LADSPA ${${_OPT}use_ladspa} CACHE INTERNAL "" )
|
||||
cmd_option( use_ladspa "Use LADSPA plug-in support [ON, OFF]" ON )
|
||||
set( USE_LADSPA ${use_ladspa} CACHE INTERNAL "" )
|
||||
|
||||
# Handle VST option
|
||||
cmd_option(
|
||||
${_OPT}use_vst
|
||||
"Use VST2 plug-in support [on, off]"
|
||||
ON
|
||||
)
|
||||
set( USE_VST ${${_OPT}use_vst} CACHE INTERNAL "" )
|
||||
cmd_option( use_vst "Use VST2 plug-in support [ON, OFF]" ON )
|
||||
set( USE_VST ${use_vst} CACHE INTERNAL "" )
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
list( APPEND SOURCES
|
||||
PRIVATE
|
||||
# ~~~
|
||||
# General source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
AColor.cpp
|
||||
AColor.h
|
||||
AColorResources.h
|
||||
@ -343,9 +334,12 @@ list( APPEND SOURCES
|
||||
ZoomInfo.h
|
||||
float_cast.h
|
||||
wxFileNameWrapper.h
|
||||
)
|
||||
|
||||
# Commands
|
||||
|
||||
# ~~~
|
||||
# Commands source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
commands/AppCommandEvent.cpp
|
||||
commands/AppCommandEvent.h
|
||||
commands/AudacityCommand.cpp
|
||||
@ -417,9 +411,13 @@ list( APPEND SOURCES
|
||||
commands/SetTrackInfoCommand.cpp
|
||||
commands/SetTrackInfoCommand.h
|
||||
commands/Validators.h
|
||||
)
|
||||
|
||||
# Built-in Effects
|
||||
|
||||
# ~~~
|
||||
# Effects source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
# Built-in effects
|
||||
effects/Amplify.cpp
|
||||
effects/Amplify.h
|
||||
effects/AutoDuck.cpp
|
||||
@ -519,50 +517,39 @@ list( APPEND SOURCES
|
||||
effects/TwoPassSimpleMono.h
|
||||
effects/Wahwah.cpp
|
||||
effects/Wahwah.h
|
||||
|
||||
# VST Effects
|
||||
|
||||
# VST effects
|
||||
$<$<BOOL:${USE_VST}>:
|
||||
effects/VST/VSTControl.h
|
||||
effects/VST/VSTEffect.cpp
|
||||
effects/VST/VSTEffect.h
|
||||
effects/VST/aeffectx.h
|
||||
>
|
||||
|
||||
$<$<AND:$<BOOL:${USE_VST}>,$<BOOL:${wxIS_GTK}>>:
|
||||
effects/VST/VSTControlGTK.cpp
|
||||
effects/VST/VSTControlGTK.h
|
||||
>
|
||||
|
||||
$<$<AND:$<BOOL:${USE_VST}>,$<BOOL:${wxIS_WIN}>>:
|
||||
effects/VST/VSTControlMSW.cpp
|
||||
effects/VST/VSTControlMSW.h
|
||||
>
|
||||
|
||||
$<$<AND:$<BOOL:${USE_VST}>,$<BOOL:${wxIS_MAC}>>:
|
||||
effects/VST/VSTControlOSX.h
|
||||
effects/VST/VSTControlOSX.mm
|
||||
>
|
||||
|
||||
# Audio Unit Effects
|
||||
|
||||
# Audio Unit effects
|
||||
$<$<AND:$<BOOL:${USE_AUDIO_UNITS}>,$<BOOL:${wxIS_MAC}>>:
|
||||
effects/audiounits/AUControl.h
|
||||
effects/audiounits/AUControl.mm
|
||||
effects/audiounits/AudioUnitEffect.cpp
|
||||
effects/audiounits/AudioUnitEffect.h
|
||||
>
|
||||
|
||||
# Ladspa Effects
|
||||
|
||||
# Ladspa effects
|
||||
$<$<BOOL:${USE_LADSPA}>:
|
||||
effects/ladspa/LadspaEffect.cpp
|
||||
effects/ladspa/LadspaEffect.h
|
||||
effects/ladspa/ladspa.h
|
||||
>
|
||||
|
||||
# LV2 Effects
|
||||
|
||||
# LV2 effects
|
||||
$<$<BOOL:${USE_LV2}>:
|
||||
effects/lv2/LV2Effect.cpp
|
||||
effects/lv2/LV2Effect.h
|
||||
@ -574,30 +561,28 @@ list( APPEND SOURCES
|
||||
effects/lv2/zix/ring.cpp
|
||||
effects/lv2/zix/ring.h
|
||||
>
|
||||
|
||||
# Nyquist Effects
|
||||
|
||||
# Nyquist effects
|
||||
$<$<BOOL:${USE_NYQUIST}>:
|
||||
effects/nyquist/LoadNyquist.cpp
|
||||
effects/nyquist/LoadNyquist.h
|
||||
effects/nyquist/Nyquist.cpp
|
||||
effects/nyquist/Nyquist.h
|
||||
>
|
||||
|
||||
# VAMP Effects
|
||||
|
||||
# VAMP effects
|
||||
$<$<BOOL:${USE_VAMP}>:
|
||||
effects/vamp/LoadVamp.cpp
|
||||
effects/vamp/LoadVamp.h
|
||||
effects/vamp/VampEffect.cpp
|
||||
effects/vamp/VampEffect.h
|
||||
>
|
||||
)
|
||||
|
||||
# Export
|
||||
|
||||
# ~~~
|
||||
# Exports source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
export/Export.cpp
|
||||
export/Export.h
|
||||
|
||||
# Standard exporters
|
||||
export/ExportCL.cpp
|
||||
export/ExportMP3.cpp
|
||||
@ -605,28 +590,27 @@ list( APPEND SOURCES
|
||||
export/ExportMultiple.cpp
|
||||
export/ExportMultiple.h
|
||||
export/ExportPCM.cpp
|
||||
|
||||
# Optional exporters
|
||||
$<$<BOOL:${USE_FFMPEG}>:
|
||||
export/ExportFFmpeg.cpp
|
||||
export/ExportFFmpegDialogs.cpp
|
||||
export/ExportFFmpegDialogs.h
|
||||
>
|
||||
|
||||
$<$<BOOL:${USE_LIBFLAC}>:
|
||||
export/ExportFLAC.cpp
|
||||
>
|
||||
|
||||
$<$<BOOL:${USE_LIBTWOLAME}>:
|
||||
export/ExportMP2.cpp
|
||||
>
|
||||
|
||||
$<$<AND:$<BOOL:${USE_LIBOGG}>,$<BOOL:${USE_LIBVORBIS}>>:
|
||||
export/ExportOGG.cpp
|
||||
>
|
||||
)
|
||||
|
||||
# Import
|
||||
|
||||
# ~~~
|
||||
# Imports source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
import/FormatClassifier.cpp
|
||||
import/FormatClassifier.h
|
||||
import/Import.cpp
|
||||
@ -638,9 +622,7 @@ list( APPEND SOURCES
|
||||
import/RawAudioGuess.h
|
||||
import/SpecPowerMeter.cpp
|
||||
import/SpecPowerMeter.h
|
||||
|
||||
# Standard importers
|
||||
|
||||
import/ImportAUP.cpp
|
||||
import/ImportLOF.cpp
|
||||
import/ImportPCM.cpp
|
||||
@ -648,32 +630,29 @@ list( APPEND SOURCES
|
||||
import/ImportPlugin.cpp
|
||||
import/ImportRaw.cpp
|
||||
import/ImportRaw.h
|
||||
|
||||
# Optional importers
|
||||
|
||||
$<$<BOOL:${USE_FFMPEG}>:
|
||||
import/ImportFFmpeg.cpp
|
||||
>
|
||||
|
||||
$<$<BOOL:${USE_LIBFLAC}>:
|
||||
import/ImportFLAC.cpp
|
||||
>
|
||||
|
||||
$<$<BOOL:${USE_MIDI}>:
|
||||
import/ImportMIDI.cpp
|
||||
import/ImportMIDI.h
|
||||
>
|
||||
|
||||
$<$<BOOL:${USE_LIBMAD}>:
|
||||
import/ImportMP3.cpp
|
||||
>
|
||||
|
||||
$<$<AND:$<BOOL:${USE_LIBOGG}>,$<BOOL:${USE_LIBVORBIS}>>:
|
||||
import/ImportOGG.cpp
|
||||
>
|
||||
)
|
||||
|
||||
# Menus
|
||||
|
||||
# ~~~
|
||||
# Menus source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
menus/ClipMenus.cpp
|
||||
menus/EditMenus.cpp
|
||||
menus/ExtraMenus.cpp
|
||||
@ -688,9 +667,12 @@ list( APPEND SOURCES
|
||||
menus/TransportMenus.cpp
|
||||
menus/ViewMenus.cpp
|
||||
menus/WindowMenus.cpp
|
||||
)
|
||||
|
||||
# Preferences
|
||||
|
||||
# ~~~
|
||||
# Preferences source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
prefs/BatchPrefs.cpp
|
||||
prefs/BatchPrefs.h
|
||||
prefs/DevicePrefs.cpp
|
||||
@ -744,9 +726,12 @@ list( APPEND SOURCES
|
||||
prefs/WaveformPrefs.h
|
||||
prefs/WaveformSettings.cpp
|
||||
prefs/WaveformSettings.h
|
||||
)
|
||||
|
||||
# Toolbars
|
||||
|
||||
# ~~~
|
||||
# Toolbars source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
toolbars/ControlToolBar.cpp
|
||||
toolbars/ControlToolBar.h
|
||||
toolbars/DeviceToolBar.cpp
|
||||
@ -775,9 +760,13 @@ list( APPEND SOURCES
|
||||
toolbars/ToolsToolBar.h
|
||||
toolbars/TranscriptionToolBar.cpp
|
||||
toolbars/TranscriptionToolBar.h
|
||||
)
|
||||
|
||||
# Tracks
|
||||
|
||||
# ~~~
|
||||
# Tracks UI source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
# Variant UIs
|
||||
tracks/labeltrack/ui/LabelDefaultClickHandle.cpp
|
||||
tracks/labeltrack/ui/LabelDefaultClickHandle.h
|
||||
tracks/labeltrack/ui/LabelGlyphHandle.cpp
|
||||
@ -851,9 +840,7 @@ list( APPEND SOURCES
|
||||
tracks/timetrack/ui/TimeTrackVZoomHandle.h
|
||||
tracks/timetrack/ui/TimeTrackView.cpp
|
||||
tracks/timetrack/ui/TimeTrackView.h
|
||||
|
||||
# Tracks UI
|
||||
|
||||
# Main UI
|
||||
tracks/ui/AffordanceHandle.cpp
|
||||
tracks/ui/AffordanceHandle.h
|
||||
tracks/ui/BackgroundCell.cpp
|
||||
@ -894,13 +881,20 @@ list( APPEND SOURCES
|
||||
tracks/ui/TrackView.h
|
||||
tracks/ui/ZoomHandle.cpp
|
||||
tracks/ui/ZoomHandle.h
|
||||
)
|
||||
|
||||
# ui helpers
|
||||
# ~~~
|
||||
# UI helpers source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
ui/AccessibleLinksFormatter.h
|
||||
ui/AccessibleLinksFormatter.cpp
|
||||
)
|
||||
|
||||
# Widgets
|
||||
|
||||
# ~~~
|
||||
# Widgets source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
widgets/AButton.cpp
|
||||
widgets/AButton.h
|
||||
widgets/ASlider.cpp
|
||||
@ -977,8 +971,12 @@ list( APPEND SOURCES
|
||||
widgets/wxPanelWrapper.cpp
|
||||
widgets/wxPanelWrapper.h
|
||||
widgets/wxTextCtrlWrapper.h
|
||||
)
|
||||
|
||||
# XML handling
|
||||
# ~~~
|
||||
# XML source files
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE
|
||||
xml/XMLFileReader.cpp
|
||||
xml/XMLFileReader.h
|
||||
xml/XMLTagHandler.cpp
|
||||
@ -986,13 +984,16 @@ list( APPEND SOURCES
|
||||
xml/XMLWriter.cpp
|
||||
xml/XMLWriter.h
|
||||
xml/audacityproject.dtd
|
||||
|
||||
Experimental.cmake
|
||||
)
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
# ~~~
|
||||
# Experimental module
|
||||
# ~~~
|
||||
list( APPEND SOURCES PRIVATE Experimental.cmake )
|
||||
|
||||
# ~~~
|
||||
# General headers
|
||||
# ~~~
|
||||
list( APPEND HEADERS
|
||||
../include/tenacity/EffectInterface.h
|
||||
../include/tenacity/Types.h
|
||||
@ -1003,28 +1004,24 @@ list( APPEND HEADERS
|
||||
../include/tenacity/EffectAutomationParameters.h
|
||||
)
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
list( APPEND INCLUDES
|
||||
PUBLIC
|
||||
${_PRVDIR}
|
||||
${CMAKE_SOURCE_DIR}/include
|
||||
${TARGET_ROOT}
|
||||
# ~~~
|
||||
# General includes
|
||||
# ~~~
|
||||
list( APPEND INCLUDES PUBLIC
|
||||
"${_PRVDIR}"
|
||||
"${CMAKE_SOURCE_DIR}/include"
|
||||
"${TARGET_ROOT}"
|
||||
)
|
||||
|
||||
#
|
||||
# Define resources
|
||||
#
|
||||
list( APPEND RESOURCES
|
||||
../presets/EQDefaultCurves.xml
|
||||
)
|
||||
# ~~~
|
||||
# General resources
|
||||
# ~~~
|
||||
list( APPEND RESOURCES ../presets/EQDefaultCurves.xml )
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
list( APPEND DEFINES
|
||||
PRIVATE
|
||||
# ~~~
|
||||
# General definitions
|
||||
# ~~~
|
||||
list( APPEND DEFINES PRIVATE
|
||||
CMAKE
|
||||
$<$<BOOL:${HAVE_LRINT}>:
|
||||
HAVE_LRINT
|
||||
@ -1042,30 +1039,26 @@ list( APPEND DEFINES
|
||||
>
|
||||
)
|
||||
|
||||
# If we have cmake 3.16 or higher, we can use precompiled headers, but
|
||||
# only use them if ccache is not available and the user hasn't disabled
|
||||
# it.
|
||||
# Default to enabling PCH on supported CMake versions if compiler caching is unavailable
|
||||
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" AND NOT CCACHE_PROGRAM AND NOT SCCACHE_PROGRAM )
|
||||
cmd_option(
|
||||
${_OPT}use_pch
|
||||
"Use precompiled headers [yes, no]"
|
||||
YES
|
||||
)
|
||||
cmd_option( use_pch "Use precompiled headers [yes, no]" YES )
|
||||
set(USE_PCH ${use_pch} CACHE INTERNAL "")
|
||||
endif()
|
||||
|
||||
audacity_append_common_compiler_options( OPTIONS "${${_OPT}use_pch}" )
|
||||
audacity_append_common_compiler_options( OPTIONS "${USE_PCH}" )
|
||||
|
||||
list( APPEND LDFLAGS
|
||||
PRIVATE
|
||||
# ~~~
|
||||
# Linker flags
|
||||
# ~~~
|
||||
list( APPEND LDFLAGS PRIVATE
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/MANIFEST:NO>
|
||||
$<$<CXX_COMPILER_ID:GNU>:-Wl,--disable-new-dtags>
|
||||
)
|
||||
|
||||
#
|
||||
#
|
||||
#
|
||||
list( APPEND LIBRARIES
|
||||
PUBLIC
|
||||
# ~~~
|
||||
# Publicly linked libraries
|
||||
# ~~~
|
||||
list( APPEND LIBRARIES PUBLIC
|
||||
${CMAKE_REQUIRED_LIBRARIES}
|
||||
ZLIB::ZLIB
|
||||
wxWidgets::wxWidgets
|
||||
@ -1102,75 +1095,46 @@ set( PKGLIBDIR "${_PKGLIBDIR}" )
|
||||
set( LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}" )
|
||||
set( HAVE_GTK ${GTK_FOUND} )
|
||||
|
||||
# Do not define these for Windows or Mac until further testing
|
||||
# can be done against ExportMP3.cpp. If either are defined, the
|
||||
# build will fail.
|
||||
if( NOT CMAKE_SYSTEM_NAME MATCHES "Windows|Darwin" )
|
||||
if( LAME_FOUND )
|
||||
set( DISABLE_DYNAMIC_LOADING_LAME YES )
|
||||
endif()
|
||||
|
||||
if( FFMPEG_FOUND )
|
||||
set( DISABLE_DYNAMIC_LOADING_FFMPEG YES )
|
||||
endif()
|
||||
endif()
|
||||
# ~~~
|
||||
# Platform specific configurations
|
||||
# ~~~
|
||||
|
||||
if( CMAKE_SYSTEM_NAME MATCHES "Windows" )
|
||||
set_target_properties(
|
||||
${TARGET}
|
||||
PROPERTIES
|
||||
# Make sure we're a GUI application and not a console tool
|
||||
WIN32_EXECUTABLE ON
|
||||
WIN32_EXECUTABLE ON # Make sure we're a GUI application
|
||||
)
|
||||
|
||||
# Define the Windows specific resources
|
||||
list( APPEND WIN_RESOURCES
|
||||
../win/tenacity.rc
|
||||
)
|
||||
|
||||
# Copy over the wxWidgets DLLs
|
||||
list( APPEND WIN_RESOURCES ../win/tenacity.rc )
|
||||
|
||||
# Copy the required wxWidgets libs into the bundle
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -D SRC="${_EXEDIR}/Tenacity.exe"
|
||||
TARGET ${TARGET}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D SRC="${_EXEDIR}/Tenacity.exe"
|
||||
-D DST="${_EXEDIR}"
|
||||
-D WXWIN="${_SHARED_PROXY_BASE_PATH}/$<CONFIG>/"
|
||||
-P ${AUDACITY_MODULE_PATH}/CopyLibs.cmake
|
||||
-P "${AUDACITY_MODULE_PATH}/CopyLibs.cmake"
|
||||
-parallel ${CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
|
||||
POST_BUILD
|
||||
)
|
||||
|
||||
# Copy the VC runtime libraries as well
|
||||
if(NOT "_X${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}" STREQUAL "_X")
|
||||
# Copy the MSVC runtime libraries as well
|
||||
if( NOT "_X${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS}" STREQUAL "_X" )
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -E copy ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${_DEST}
|
||||
TARGET ${TARGET}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} ${_DEST}
|
||||
POST_BUILD
|
||||
)
|
||||
endif()
|
||||
|
||||
elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
# Bug 2400 workaround
|
||||
#
|
||||
# Replaces the SDK version in the built executable with 10.13 to
|
||||
# prevent high CPU usage and slow drawing on Mojave or newer
|
||||
check_for_platform_version()
|
||||
if( PLATFORM_VERSION_SUPPORTED )
|
||||
list( APPEND LDFLAGS
|
||||
PRIVATE
|
||||
-Wl,-platform_version,macos,${MIN_MACOS_VERSION},${TARGET_MACOS_VERSION}
|
||||
)
|
||||
list( APPEND LDFLAGS PRIVATE -Wl,-platform_version,macos,${MIN_MACOS_VERSION},${TARGET_MACOS_VERSION} )
|
||||
else()
|
||||
list( APPEND LDFLAGS
|
||||
PRIVATE
|
||||
-Wl,-sdk_version,10.13
|
||||
)
|
||||
list( APPEND LDFLAGS PRIVATE -Wl,-sdk_version, ${TARGET_MACOS_VERSION} )
|
||||
endif()
|
||||
|
||||
# Define Mac specific resources
|
||||
@ -1187,16 +1151,13 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
|
||||
set_target_properties(
|
||||
${TARGET}
|
||||
PROPERTIES
|
||||
# Build a bundle
|
||||
MACOSX_BUNDLE ON
|
||||
# Add the resources
|
||||
PROPERTIES # Build a bundle
|
||||
MACOSX_BUNDLE ON # Add the resources
|
||||
RESOURCE "${MAC_RESOURCES};${RESOURCES}"
|
||||
)
|
||||
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DESTDIR}" )
|
||||
|
||||
# These sources must be compiled as Objective C++ and excluded
|
||||
# from precompiled header usage
|
||||
# These sources must be compiled as Objective C++ and excluded from precompiled header usage
|
||||
set_source_files_properties(
|
||||
AudacityApp.mm
|
||||
KeyboardCapture.cpp
|
||||
@ -1210,17 +1171,17 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
SKIP_PRECOMPILE_HEADERS YES
|
||||
)
|
||||
|
||||
list( APPEND LIBRARIES
|
||||
PRIVATE
|
||||
list( APPEND LIBRARIES PRIVATE
|
||||
"-framework Foundation"
|
||||
"-framework Cocoa"
|
||||
"-framework Carbon"
|
||||
)
|
||||
|
||||
if(USE_AUDIO_UNITS)
|
||||
list(APPEND LIBRARIES
|
||||
PRIVATE
|
||||
list( APPEND LIBRARIES PRIVATE
|
||||
"-framework AudioUnit"
|
||||
"-framework CoreAudioKit")
|
||||
"-framework CoreAudioKit"
|
||||
)
|
||||
endif()
|
||||
|
||||
# Use the Aqua theme
|
||||
@ -1228,13 +1189,12 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
|
||||
# Copy the required wxWidgets libs into the bundle
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -D SRC="${_EXEDIR}/Tenacity"
|
||||
TARGET ${TARGET}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D SRC="${_EXEDIR}/Tenacity"
|
||||
-D DST="${_PKGLIB}"
|
||||
-D WXWIN="${_SHARED_PROXY_BASE_PATH}/$<CONFIG>"
|
||||
-P ${AUDACITY_MODULE_PATH}/CopyLibs.cmake
|
||||
-P "${AUDACITY_MODULE_PATH}/CopyLibs.cmake"
|
||||
-parallel ${CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
POST_BUILD
|
||||
)
|
||||
@ -1248,18 +1208,26 @@ elseif( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
|
||||
|
||||
set_target_property_all( "Wrapper" RUNTIME_OUTPUT_DIRECTORY "${_EXEDIR}" )
|
||||
organize_source( "${WRAPPER_ROOT}" "mac" "${WRAPPER_SOURCES}" )
|
||||
|
||||
else()
|
||||
# TODO: Test ExportMP3.cpp more to allow us to do this on more OSes
|
||||
if( LAME_FOUND )
|
||||
set( DISABLE_DYNAMIC_LOADING_LAME YES )
|
||||
endif()
|
||||
|
||||
if( FFMPEG_FOUND )
|
||||
set( DISABLE_DYNAMIC_LOADING_FFMPEG YES )
|
||||
endif()
|
||||
|
||||
set_target_property_all( ${TARGET} RUNTIME_OUTPUT_DIRECTORY "${_DEST}" )
|
||||
|
||||
# Build the list of mimetypes
|
||||
#
|
||||
# (Don't use generator expressions since it will leave null/empty
|
||||
# entries in the list.)
|
||||
set( MIMETYPES
|
||||
application/x-audacity-project
|
||||
# Build the list of mimetypes (we can't use generator expressions)
|
||||
set( MIMETYPES "" )
|
||||
|
||||
list( APPEND MIMETYPES
|
||||
application/x-tenacity-project
|
||||
)
|
||||
if( USE_FFMPEG )
|
||||
|
||||
if(USE_FFMPEG)
|
||||
list( APPEND MIMETYPES
|
||||
audio/aac
|
||||
audio/ac3
|
||||
@ -1268,25 +1236,30 @@ else()
|
||||
video/mpeg
|
||||
)
|
||||
endif()
|
||||
if( USE_LIBFLAC )
|
||||
|
||||
|
||||
if(USE_LIBFLAC)
|
||||
list( APPEND MIMETYPES
|
||||
audio/flac
|
||||
audio/x-flac
|
||||
)
|
||||
endif()
|
||||
if( USE_LIBMAD )
|
||||
|
||||
if(USE_LIBMAD)
|
||||
list( APPEND MIMETYPES
|
||||
audio/mpeg
|
||||
)
|
||||
endif()
|
||||
if( USE_SNDFILE )
|
||||
|
||||
if(USE_SNDFILE)
|
||||
list( APPEND MIMETYPES
|
||||
audio/basic
|
||||
audio/x-aiff
|
||||
audio/x-wav
|
||||
)
|
||||
endif()
|
||||
if( USE_LIBOGG AND USE_LIBVORBIS )
|
||||
|
||||
if(USE_LIBOGG AND USE_LIBVORBIS)
|
||||
list( APPEND MIMETYPES
|
||||
application/ogg
|
||||
audio/x-vorbis+ogg
|
||||
@ -1298,13 +1271,12 @@ else()
|
||||
|
||||
# Copy the required wxWidgets libs into the bundle
|
||||
add_custom_command(
|
||||
TARGET
|
||||
${TARGET}
|
||||
COMMAND
|
||||
${CMAKE_COMMAND} -D SRC="${_EXEDIR}/tenacity"
|
||||
TARGET ${TARGET}
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
-D SRC="${_EXEDIR}/tenacity"
|
||||
-D DST="${_DEST}/${_PKGLIB}"
|
||||
-D WXWIN="${_SHARED_PROXY_BASE_PATH}/$<CONFIG>"
|
||||
-P ${AUDACITY_MODULE_PATH}/CopyLibs.cmake
|
||||
-P "${AUDACITY_MODULE_PATH}/CopyLibs.cmake"
|
||||
-parallel ${CMAKE_BUILD_PARALLEL_LEVEL}
|
||||
POST_BUILD
|
||||
)
|
||||
@ -1322,10 +1294,8 @@ organize_source( "${TARGET_ROOT}/../win" "win" "${WIN_RESOURCES}" )
|
||||
# Get those pesky CMake files out of the way (on Windows)
|
||||
#
|
||||
source_group(
|
||||
TREE
|
||||
"${_INTDIR}"
|
||||
PREFIX
|
||||
"CMake"
|
||||
TREE "${_INTDIR}"
|
||||
PREFIX "CMake"
|
||||
FILES
|
||||
${_INTDIR}/CMakeFiles/Tenacity.dir/cmake_pch.cxx
|
||||
${_INTDIR}/CMakeFiles/Tenacity.dir/cmake_pch.hxx
|
||||
@ -1334,34 +1304,37 @@ source_group(
|
||||
# Define TENACITY_DLL_API
|
||||
import_symbol_define( import_symbol TENACITY_DLL )
|
||||
export_symbol_define( export_symbol TENACITY_DLL )
|
||||
list( APPEND DEFINES PRIVATE "${export_symbol}" INTERFACE "${import_symbol}" )
|
||||
list( APPEND DEFINES
|
||||
PRIVATE
|
||||
"${export_symbol}"
|
||||
INTERFACE
|
||||
"${import_symbol}"
|
||||
)
|
||||
|
||||
target_sources( ${TARGET} PRIVATE ${HEADERS} ${SOURCES} ${RESOURCES} ${MAC_RESOURCES} ${WIN_RESOURCES} )
|
||||
target_compile_definitions( ${TARGET} PRIVATE ${DEFINES} )
|
||||
target_compile_definitions( ${TARGET} PRIVATE ${CXX_WARNINGS_SILENCE_DEFINES})
|
||||
target_compile_definitions( ${TARGET} PRIVATE ${CXX_WARNINGS_SILENCE_DEFINES} )
|
||||
target_compile_options( ${TARGET} PRIVATE ${OPTIONS} )
|
||||
target_include_directories( ${TARGET} PRIVATE ${INCLUDES} )
|
||||
target_link_options( ${TARGET} PRIVATE ${LDFLAGS} )
|
||||
# Somehow the "version" target gets added to the LIBRARIES list? But only on Windows??
|
||||
list(REMOVE_ITEM LIBRARIES version)
|
||||
list( REMOVE_ITEM LIBRARIES version )
|
||||
target_link_libraries( ${TARGET} ${LIBRARIES} )
|
||||
target_link_libraries( ${TARGET} PUBLIC ${AUDACITY_LIBRARIES} )
|
||||
|
||||
if( CMAKE_VERSION VERSION_GREATER_EQUAL "3.16" )
|
||||
if( ${_OPT}use_pch )
|
||||
if( USE_PCH )
|
||||
message( STATUS "Using precompiled headers" )
|
||||
target_precompile_headers( ${TARGET} PRIVATE
|
||||
$<$<PLATFORM_ID:Windows>:${CMAKE_BINARY_DIR}/src/private/configwin.h>
|
||||
target_precompile_headers(
|
||||
${TARGET} PRIVATE $<$<PLATFORM_ID:Windows>:${CMAKE_BINARY_DIR}/src/private/configwin.h>
|
||||
$<$<PLATFORM_ID:Darwin>:${CMAKE_BINARY_DIR}/src/private/configmac.h>
|
||||
$<$<NOT:$<PLATFORM_ID:Windows,Darwin>>:${CMAKE_BINARY_DIR}/src/private/configunix.h>
|
||||
AudacityHeaders.h
|
||||
)
|
||||
else()
|
||||
else()
|
||||
message( STATUS "Not using precompiled headers" )
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if( "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
if( CMAKE_GENERATOR MATCHES "Xcode|Visual Studio*" )
|
||||
install(
|
||||
DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/$<CONFIG>/"
|
||||
DESTINATION "."
|
||||
@ -1371,43 +1344,61 @@ if( "${CMAKE_GENERATOR}" MATCHES "Xcode|Visual Studio*" )
|
||||
)
|
||||
else()
|
||||
if( APPLE )
|
||||
install( TARGETS ${TARGET}
|
||||
install(
|
||||
TARGETS ${TARGET}
|
||||
DESTINATION "."
|
||||
RESOURCE DESTINATION "${_APPDIR}/Resources" )
|
||||
RESOURCE DESTINATION "${_APPDIR}/Resources"
|
||||
)
|
||||
elseif( WIN32 )
|
||||
install( DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
|
||||
install(
|
||||
DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
|
||||
DESTINATION "."
|
||||
USE_SOURCE_PERMISSIONS
|
||||
PATTERN "*.pdb" EXCLUDE
|
||||
PATTERN "*.ilk" EXCLUDE )
|
||||
PATTERN "*.ilk" EXCLUDE
|
||||
)
|
||||
else()
|
||||
install( TARGETS ${TARGET} RUNTIME )
|
||||
install( DIRECTORY "${_DEST}/${_LIBDIR}/"
|
||||
install(
|
||||
DIRECTORY "${_DEST}/${_LIBDIR}/"
|
||||
DESTINATION "${_LIBDIR}"
|
||||
USE_SOURCE_PERMISSIONS
|
||||
FILES_MATCHING PATTERN "*.so*" )
|
||||
install( FILES "${_INTDIR}/tenacity.desktop"
|
||||
DESTINATION "${_DATADIR}/applications" )
|
||||
install( FILES "${CMAKE_SOURCE_DIR}/LICENSE.txt" "${CMAKE_SOURCE_DIR}/README.md"
|
||||
DESTINATION "${_DATADIR}/doc/${AUDACITY_NAME}" )
|
||||
install( FILES "${_SRCDIR}/tenacity.xml"
|
||||
DESTINATION "${_DATADIR}/mime/packages" )
|
||||
install( FILES "${CMAKE_SOURCE_DIR}/presets/EQDefaultCurves.xml"
|
||||
DESTINATION "${_PKGDATA}" )
|
||||
install( PROGRAMS "${PROJECT_SOURCE_DIR}/linux/tenacity.sh"
|
||||
USE_SOURCE_PERMISSIONS FILES_MATCHING
|
||||
PATTERN "*.so*"
|
||||
)
|
||||
install(
|
||||
FILES "${_INTDIR}/tenacity.desktop"
|
||||
DESTINATION "${_DATADIR}/applications"
|
||||
)
|
||||
install(
|
||||
FILES "${CMAKE_SOURCE_DIR}/LICENSE.txt" "${CMAKE_SOURCE_DIR}/README.md"
|
||||
DESTINATION "${_DATADIR}/doc/${AUDACITY_NAME}"
|
||||
)
|
||||
install(
|
||||
FILES "${_SRCDIR}/tenacity.xml"
|
||||
DESTINATION "${_DATADIR}/mime/packages"
|
||||
)
|
||||
install(
|
||||
FILES "${CMAKE_SOURCE_DIR}/presets/EQDefaultCurves.xml"
|
||||
DESTINATION "${_PKGDATA}"
|
||||
)
|
||||
install(
|
||||
PROGRAMS "${PROJECT_SOURCE_DIR}/linux/tenacity.sh"
|
||||
DESTINATION "."
|
||||
RENAME "tenacity" )
|
||||
RENAME "tenacity"
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#[[
|
||||
# collect dependency information for third party libraries
|
||||
list( APPEND GRAPH_EDGES "Tenacity [shape=house]" )
|
||||
foreach( LIBRARY ${LIBRARIES} )
|
||||
if (NOT LIBRARY MATCHES "PUBLIC|PRIVATE|INTERFACE")
|
||||
canonicalize_node_name(LIBRARY "${LIBRARY}")
|
||||
if( NOT LIBRARY MATCHES "PUBLIC|PRIVATE|INTERFACE" )
|
||||
canonicalize_node_name(LIBRARY "${LIBRARY}" )
|
||||
list( APPEND GRAPH_EDGES "\"${TARGET}\" -> \"${LIBRARY}\"" )
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
#propagate collected edgets to root CMakeLists.txt
|
||||
set( GRAPH_EDGES "${GRAPH_EDGES}" PARENT_SCOPE )
|
||||
#]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user