CMake: add support for USE_*=none (from the os-modules branch)

This commit is contained in:
Adriaan de Groot 2020-06-22 13:39:36 +02:00
parent 7f85781d99
commit fde1aad465
2 changed files with 21 additions and 2 deletions

View File

@ -94,9 +94,25 @@ option( BUILD_SCHEMA_TESTING "Enable schema-validation-tests" ON )
# all the implementations are enabled (this just means they are
# **available** to `settings.conf`, not that they are used).
#
# Currently, only USE_services is in use (to pick only one of the two
# modules, systemd or openrc).
# To explicitly disable a set of modules, set USE_<foo>=none
# (e.g. the literal string none), which won't match any of the
# modules but is handled specially. This is the default for
# USE_os, which are modules for specialty non-Linux distributions.
#
# The following USE_* functionalities are available:
# - *services* picks one of the two service-configuration modules,
# for either systemd or openrc. This defaults to empty so that
# **both** modules are available.
# - *os* picks an OS-specific module for things-that-are-not-Linux.
# It is generally discouraged to use this unless your distro is
# completely unable to use standard Linux tools for configuration.
# This defaults to *none* so that nothing gets picked up and nothing
# is packaged -- you must explicitly set it to empty to get all of
# the modules, but that hardly makes sense. Note, too that there
# are no os-* modules shipped with Calamares. They live in the
# *calamares-extensions* repository.
set( USE_services "" CACHE STRING "Select the services module to use" )
set( USE_os "none" CACHE STRING "Select the OS-specific module to include" )
### Calamares application info
#

View File

@ -59,6 +59,9 @@ calamares_explain_skipped_modules( ${LIST_SKIPPED_MODULES} )
foreach( _category ${_use_categories} )
list( FIND _found_categories ${_category} _found )
if ( ${USE_${_category}} STREQUAL "none" )
set( _found 0 )
endif()
if ( _found EQUAL -1 )
message( FATAL_ERROR "USE_${_category} is set to ${USE_${_category}} and no module matches." )
endif()