mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
cmake-lint: cargo-feature
is not a valid identifier in CMake
cmake-lint reports that `cargo-feature` is not a valid identifier. Change it to `cargo_feature` instead, even though this seems to work anyway.
This commit is contained in:
parent
44ec841609
commit
a24190924b
1 changed files with 6 additions and 6 deletions
|
@ -30,30 +30,30 @@ set(SLINT_COMPILER "" CACHE FILEPATH "Path to the slint-compiler executable. Whe
|
|||
set(SLINT_LIBRARY_CARGO_FLAGS "" CACHE STRING
|
||||
"Flags to pass to cargo when building the Slint runtime library")
|
||||
|
||||
function(define_cargo_feature cargo-feature description default)
|
||||
function(define_cargo_feature cargo_feature description default)
|
||||
# turn foo-bar into SLINT_FEATURE_FOO_BAR
|
||||
string(TOUPPER "${cargo-feature}" cmake_option)
|
||||
string(TOUPPER "${cargo_feature}" cmake_option)
|
||||
string(REPLACE "-" "_" cmake_option "${cmake_option}")
|
||||
set(cmake_option "SLINT_FEATURE_${cmake_option}")
|
||||
option("${cmake_option}" "${description}" ${default})
|
||||
|
||||
if(${cmake_option})
|
||||
list(APPEND features ${cargo-feature})
|
||||
list(APPEND features ${cargo_feature})
|
||||
endif()
|
||||
|
||||
set(features "${features}" PARENT_SCOPE)
|
||||
add_feature_info(${cmake_option} ${cmake_option} ${description})
|
||||
endfunction()
|
||||
|
||||
function(define_cargo_dependent_feature cargo-feature description default depends_condition)
|
||||
function(define_cargo_dependent_feature cargo_feature description default depends_condition)
|
||||
# turn foo-bar into SLINT_FEATURE_FOO_BAR
|
||||
string(TOUPPER "${cargo-feature}" cmake_option)
|
||||
string(TOUPPER "${cargo_feature}" cmake_option)
|
||||
string(REPLACE "-" "_" cmake_option "${cmake_option}")
|
||||
set(cmake_option "SLINT_FEATURE_${cmake_option}")
|
||||
cmake_dependent_option("${cmake_option}" "${description}" ${default} ${depends_condition} OFF)
|
||||
|
||||
if(${cmake_option})
|
||||
list(APPEND features ${cargo-feature})
|
||||
list(APPEND features ${cargo_feature})
|
||||
endif()
|
||||
|
||||
set(features "${features}" PARENT_SCOPE)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue