diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44e48225..78270416 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -117,7 +117,7 @@ jobs: run: | mod-plugin-builder /usr/local/bin/cmake "$GITHUB_WORKSPACE" \ -DSFIZZ_SYSTEM_PROCESSOR=armv7-a \ - -DCMAKE_BUILD_TYPE=Release -DSFIZZ_JACK=OFF -DSFIZZ_LV2_UI=OFF + -DCMAKE_BUILD_TYPE=Release -DSFIZZ_JACK=OFF -DSFIZZ_VST=OFF -DSFIZZ_LV2_UI=OFF - name: Build shell: bash working-directory: ${{runner.workspace}}/build diff --git a/CMakeLists.txt b/CMakeLists.txt index e26cc1bb..3e2149df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,24 +16,26 @@ set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake") include (BuildType) # Build Options +include (OptionEx) + set (BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests [default: OFF]") -option (ENABLE_LTO "Enable Link Time Optimization [default: ON]" ON) -option (SFIZZ_JACK "Enable JACK stand-alone build [default: ON]" ON) -option (SFIZZ_RENDER "Enable renderer of SMF files [default: ON]" ON) -option (SFIZZ_LV2 "Enable LV2 plug-in build [default: ON]" ON) -option (SFIZZ_LV2_UI "Enable LV2 plug-in user interface [default: ON]" ON) -option (SFIZZ_VST "Enable VST plug-in build [default: OFF]" OFF) -option (SFIZZ_AU "Enable AU plug-in build [default: OFF]" OFF) -option (SFIZZ_BENCHMARKS "Enable benchmarks build [default: OFF]" OFF) -option (SFIZZ_TESTS "Enable tests build [default: OFF]" OFF) -option (SFIZZ_DEMOS "Enable feature demos build [default: OFF]" OFF) -option (SFIZZ_DEVTOOLS "Enable developer tools build [default: OFF]" OFF) -option (SFIZZ_SHARED "Enable shared library build [default: ON]" ON) -option (SFIZZ_USE_SNDFILE "Enable use of the sndfile library [default: ON]" ON) -option (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg [default: OFF]" OFF) -option (SFIZZ_STATIC_DEPENDENCIES "Link dependencies statically [default: OFF]" OFF) -option (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds [default: OFF]" OFF) +option_ex (ENABLE_LTO "Enable Link Time Optimization" ON) +option_ex (SFIZZ_JACK "Enable JACK stand-alone build" CMAKE_SYSTEM_NAME STREQUAL "Linux") +option_ex (SFIZZ_RENDER "Enable renderer of SMF files" ON) +option_ex (SFIZZ_LV2 "Enable LV2 plug-in build" ON) +option_ex (SFIZZ_LV2_UI "Enable LV2 plug-in user interface" ON) +option_ex (SFIZZ_VST "Enable VST plug-in build" ON) +option_ex (SFIZZ_AU "Enable AU plug-in build" APPLE) +option_ex (SFIZZ_BENCHMARKS "Enable benchmarks build" OFF) +option_ex (SFIZZ_TESTS "Enable tests build" OFF) +option_ex (SFIZZ_DEMOS "Enable feature demos build" OFF) +option_ex (SFIZZ_DEVTOOLS "Enable developer tools build" OFF) +option_ex (SFIZZ_SHARED "Enable shared library build" ON) +option_ex (SFIZZ_USE_SNDFILE "Enable use of the sndfile library" ON) +option_ex (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg" OFF) +option_ex (SFIZZ_STATIC_DEPENDENCIES "Link dependencies statically" OFF) +option_ex (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF) include (SfizzConfig) include (SfizzDeps) diff --git a/cmake/OptionEx.cmake b/cmake/OptionEx.cmake new file mode 100644 index 00000000..fda33a95 --- /dev/null +++ b/cmake/OptionEx.cmake @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: BSD-2-Clause + +# This code is part of the sfizz library and is licensed under a BSD 2-clause +# license. You should have receive a LICENSE.md file along with the code. +# If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz + +# Macro: option_ex(OPTION DOC [CONDITION]) +# Defines an option, with these characteristics: +# - A suffix [default: ON/OFF] is appended to the documentation +# - The value is interpreted like a conditional expression +macro(option_ex option doc) + if(${ARGN}) + set(_value ON) + else() + set(_value OFF) + endif() + option("${option}" "${doc} [default: ${_value}]" "${_value}") + unset(_value) +endmacro() diff --git a/scripts/appveyor/before_build.cmd b/scripts/appveyor/before_build.cmd index a9fa0f65..0b7804cd 100644 --- a/scripts/appveyor/before_build.cmd +++ b/scripts/appveyor/before_build.cmd @@ -6,7 +6,6 @@ if %platform%==x86 set RELEASE_ARCH=Win32 if %platform%==x64 set RELEASE_ARCH=x64 cmake .. -G"Visual Studio 16 2019" -A"%RELEASE_ARCH%"^ - -DSFIZZ_JACK=OFF^ -DSFIZZ_BENCHMARKS=OFF^ -DSFIZZ_TESTS=ON^ -DSFIZZ_LV2=ON^ diff --git a/scripts/appveyor/before_build.sh b/scripts/appveyor/before_build.sh index 329b6c1f..213ab8a3 100644 --- a/scripts/appveyor/before_build.sh +++ b/scripts/appveyor/before_build.sh @@ -6,7 +6,6 @@ mkdir -p build/${INSTALL_DIR} && cd build cmake -DCMAKE_BUILD_TYPE=Release \ -DSFIZZ_VST=ON \ -DSFIZZ_AU=ON \ - -DSFIZZ_JACK=OFF \ -DSFIZZ_RENDER=OFF \ -DSFIZZ_SHARED=OFF \ -DSFIZZ_TESTS=ON \