System-dependent options

This commit is contained in:
Jean Pierre Cimalando 2021-02-01 02:47:40 +01:00
parent ea0c122e0f
commit c27e8f409f
5 changed files with 38 additions and 19 deletions

View file

@ -117,7 +117,7 @@ jobs:
run: | run: |
mod-plugin-builder /usr/local/bin/cmake "$GITHUB_WORKSPACE" \ mod-plugin-builder /usr/local/bin/cmake "$GITHUB_WORKSPACE" \
-DSFIZZ_SYSTEM_PROCESSOR=armv7-a \ -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 - name: Build
shell: bash shell: bash
working-directory: ${{runner.workspace}}/build working-directory: ${{runner.workspace}}/build

View file

@ -16,24 +16,26 @@ set (CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include (BuildType) include (BuildType)
# Build Options # Build Options
include (OptionEx)
set (BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests [default: OFF]") set (BUILD_TESTING OFF CACHE BOOL "Disable Abseil's tests [default: OFF]")
option (ENABLE_LTO "Enable Link Time Optimization [default: ON]" ON) option_ex (ENABLE_LTO "Enable Link Time Optimization" ON)
option (SFIZZ_JACK "Enable JACK stand-alone build [default: ON]" ON) option_ex (SFIZZ_JACK "Enable JACK stand-alone build" CMAKE_SYSTEM_NAME STREQUAL "Linux")
option (SFIZZ_RENDER "Enable renderer of SMF files [default: ON]" ON) option_ex (SFIZZ_RENDER "Enable renderer of SMF files" ON)
option (SFIZZ_LV2 "Enable LV2 plug-in build [default: ON]" ON) option_ex (SFIZZ_LV2 "Enable LV2 plug-in build" ON)
option (SFIZZ_LV2_UI "Enable LV2 plug-in user interface [default: ON]" ON) option_ex (SFIZZ_LV2_UI "Enable LV2 plug-in user interface" ON)
option (SFIZZ_VST "Enable VST plug-in build [default: OFF]" OFF) option_ex (SFIZZ_VST "Enable VST plug-in build" ON)
option (SFIZZ_AU "Enable AU plug-in build [default: OFF]" OFF) option_ex (SFIZZ_AU "Enable AU plug-in build" APPLE)
option (SFIZZ_BENCHMARKS "Enable benchmarks build [default: OFF]" OFF) option_ex (SFIZZ_BENCHMARKS "Enable benchmarks build" OFF)
option (SFIZZ_TESTS "Enable tests build [default: OFF]" OFF) option_ex (SFIZZ_TESTS "Enable tests build" OFF)
option (SFIZZ_DEMOS "Enable feature demos build [default: OFF]" OFF) option_ex (SFIZZ_DEMOS "Enable feature demos build" OFF)
option (SFIZZ_DEVTOOLS "Enable developer tools build [default: OFF]" OFF) option_ex (SFIZZ_DEVTOOLS "Enable developer tools build" OFF)
option (SFIZZ_SHARED "Enable shared library build [default: ON]" ON) option_ex (SFIZZ_SHARED "Enable shared library build" ON)
option (SFIZZ_USE_SNDFILE "Enable use of the sndfile library [default: ON]" ON) option_ex (SFIZZ_USE_SNDFILE "Enable use of the sndfile library" ON)
option (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg [default: OFF]" OFF) option_ex (SFIZZ_USE_VCPKG "Assume that sfizz is build using vcpkg" OFF)
option (SFIZZ_STATIC_DEPENDENCIES "Link dependencies statically [default: OFF]" OFF) option_ex (SFIZZ_STATIC_DEPENDENCIES "Link dependencies statically" OFF)
option (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds [default: OFF]" OFF) option_ex (SFIZZ_RELEASE_ASSERTS "Forced assertions in release builds" OFF)
include (SfizzConfig) include (SfizzConfig)
include (SfizzDeps) include (SfizzDeps)

19
cmake/OptionEx.cmake Normal file
View file

@ -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()

View file

@ -6,7 +6,6 @@ if %platform%==x86 set RELEASE_ARCH=Win32
if %platform%==x64 set RELEASE_ARCH=x64 if %platform%==x64 set RELEASE_ARCH=x64
cmake .. -G"Visual Studio 16 2019" -A"%RELEASE_ARCH%"^ cmake .. -G"Visual Studio 16 2019" -A"%RELEASE_ARCH%"^
-DSFIZZ_JACK=OFF^
-DSFIZZ_BENCHMARKS=OFF^ -DSFIZZ_BENCHMARKS=OFF^
-DSFIZZ_TESTS=ON^ -DSFIZZ_TESTS=ON^
-DSFIZZ_LV2=ON^ -DSFIZZ_LV2=ON^

View file

@ -6,7 +6,6 @@ mkdir -p build/${INSTALL_DIR} && cd build
cmake -DCMAKE_BUILD_TYPE=Release \ cmake -DCMAKE_BUILD_TYPE=Release \
-DSFIZZ_VST=ON \ -DSFIZZ_VST=ON \
-DSFIZZ_AU=ON \ -DSFIZZ_AU=ON \
-DSFIZZ_JACK=OFF \
-DSFIZZ_RENDER=OFF \ -DSFIZZ_RENDER=OFF \
-DSFIZZ_SHARED=OFF \ -DSFIZZ_SHARED=OFF \
-DSFIZZ_TESTS=ON \ -DSFIZZ_TESTS=ON \