mirror of
https://github.com/slint-ui/slint.git
synced 2025-11-25 13:43:50 +00:00
Rename the SixtyFPS CMake interface
This commit is contained in:
parent
c333b4de2b
commit
b1a70f9e58
31 changed files with 161 additions and 152 deletions
2
.github/workflows/build_docs.yaml
vendored
2
.github/workflows/build_docs.yaml
vendored
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
# for which the stable alternative is not yet available
|
# for which the stable alternative is not yet available
|
||||||
RUSTFLAGS: -D warnings -W deprecated
|
RUSTFLAGS: -D warnings -W deprecated
|
||||||
RUSTDOCFLAGS: --html-in-header=/home/runner/work/sixtyfps/sixtyfps/docs/resources/sixtyfps-docs-preview.html --html-in-header=/home/runner/work/sixtyfps/sixtyfps/docs/resources/sixtyfps-docs-highlight.html -D warnings -W deprecated
|
RUSTDOCFLAGS: --html-in-header=/home/runner/work/sixtyfps/sixtyfps/docs/resources/sixtyfps-docs-preview.html --html-in-header=/home/runner/work/sixtyfps/sixtyfps/docs/resources/sixtyfps-docs-highlight.html -D warnings -W deprecated
|
||||||
SIXTYFPS_NO_QT: 1
|
SLINT_NO_QT: 1
|
||||||
CARGO_INCREMENTAL: false
|
CARGO_INCREMENTAL: false
|
||||||
MDBOOK_VERSION: 0.4.10
|
MDBOOK_VERSION: 0.4.10
|
||||||
MDBOOK_LINKCHECK_VERSION: 0.7.4
|
MDBOOK_LINKCHECK_VERSION: 0.7.4
|
||||||
|
|
|
||||||
14
.github/workflows/ci.yaml
vendored
14
.github/workflows/ci.yaml
vendored
|
|
@ -50,7 +50,7 @@ jobs:
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: |
|
||||||
echo "SIXTYFPS_STYLE=fluent" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "SIXTYFPS_STYLE=fluent" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
echo "SIXTYFPS_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "SLINT_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
|
|
@ -127,7 +127,7 @@ jobs:
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: |
|
||||||
echo "SIXTYFPS_STYLE=fluent" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "SIXTYFPS_STYLE=fluent" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
echo "SIXTYFPS_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
echo "SLINT_NO_QT=1" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
|
|
@ -241,7 +241,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||||
cmakeListsTxtPath: CMakeLists.txt
|
cmakeListsTxtPath: CMakeLists.txt
|
||||||
cmakeAppendedArgs: '-DBUILD_TESTING=ON -DSIXTYFPS_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Debug'
|
cmakeAppendedArgs: '-DBUILD_TESTING=ON -DSLINT_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Debug'
|
||||||
buildDirectory: ${{ runner.workspace }}/cppbuild
|
buildDirectory: ${{ runner.workspace }}/cppbuild
|
||||||
buildWithCMakeArgs: '--config Debug'
|
buildWithCMakeArgs: '--config Debug'
|
||||||
- name: ctest
|
- name: ctest
|
||||||
|
|
@ -254,7 +254,7 @@ jobs:
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: cpp_bin-${{ matrix.os }}
|
name: cpp_bin-${{ matrix.os }}
|
||||||
path: ${{ runner.workspace }}/cppbuild/SixtyFPS-cpp-*
|
path: ${{ runner.workspace }}/cppbuild/Slint-cpp-*
|
||||||
|
|
||||||
cpp_package_test:
|
cpp_package_test:
|
||||||
needs: [cpp_cmake]
|
needs: [cpp_cmake]
|
||||||
|
|
@ -287,14 +287,14 @@ jobs:
|
||||||
- name: unpack package
|
- name: unpack package
|
||||||
run: |
|
run: |
|
||||||
mkdir package
|
mkdir package
|
||||||
tar xvf cpp-package/SixtyFPS-cpp-*.tar.gz -C package --strip-components=1
|
tar xvf cpp-package/Slint-cpp-*.tar.gz -C package --strip-components=1
|
||||||
echo "CMAKE_PREFIX_PATH=`pwd`/package" >> $GITHUB_ENV
|
echo "CMAKE_PREFIX_PATH=`pwd`/package" >> $GITHUB_ENV
|
||||||
- name: Build examples
|
- name: Build examples
|
||||||
uses: lukka/run-cmake@v3.4
|
uses: lukka/run-cmake@v3.4
|
||||||
with:
|
with:
|
||||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||||
cmakeListsTxtPath: examples/CMakeLists.txt
|
cmakeListsTxtPath: examples/CMakeLists.txt
|
||||||
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=Debug -DSIXTYFPS_FEATURE_INTERPRETER=1 -DSIXTYFPS_FEATURE_BACKEND_QT=1'
|
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=Debug -DSLINT_FEATURE_INTERPRETER=1 -DSLINT_FEATURE_BACKEND_QT=1'
|
||||||
buildDirectory: ${{ runner.workspace }}/examples/build
|
buildDirectory: ${{ runner.workspace }}/examples/build
|
||||||
buildWithCMakeArgs: '--config Debug'
|
buildWithCMakeArgs: '--config Debug'
|
||||||
|
|
||||||
|
|
@ -311,7 +311,7 @@ jobs:
|
||||||
# and check that it worked with the interpreter test.
|
# and check that it worked with the interpreter test.
|
||||||
updater_test:
|
updater_test:
|
||||||
env:
|
env:
|
||||||
SIXTYFPS_NO_QT: 1
|
SLINT_NO_QT: 1
|
||||||
CARGO_INCREMENTAL: false
|
CARGO_INCREMENTAL: false
|
||||||
# There were binding loops with layout in our demo, so ignore theses errors
|
# There were binding loops with layout in our demo, so ignore theses errors
|
||||||
# Also ignore errors that were warnings before
|
# Also ignore errors that were warnings before
|
||||||
|
|
|
||||||
4
.github/workflows/cpp_package.yaml
vendored
4
.github/workflows/cpp_package.yaml
vendored
|
|
@ -72,7 +72,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
|
||||||
cmakeListsTxtPath: CMakeLists.txt
|
cmakeListsTxtPath: CMakeLists.txt
|
||||||
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DSIXTYFPS_PACKAGE_BUNDLE_QT=ON'
|
cmakeAppendedArgs: '-DCMAKE_BUILD_TYPE=RelWithDebInfo -DSLINT_PACKAGE_BUNDLE_QT=ON'
|
||||||
buildDirectory: ${{ runner.workspace }}/cppbuild
|
buildDirectory: ${{ runner.workspace }}/cppbuild
|
||||||
buildWithCMakeArgs: '--config Release'
|
buildWithCMakeArgs: '--config Release'
|
||||||
- name: cpack
|
- name: cpack
|
||||||
|
|
@ -82,4 +82,4 @@ jobs:
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: cpp_bin
|
name: cpp_bin
|
||||||
path: ${{ runner.workspace }}/cppbuild/SixtyFPS-cpp-*
|
path: ${{ runner.workspace }}/cppbuild/Slint-cpp-*
|
||||||
|
|
|
||||||
2
.github/workflows/crater.yaml
vendored
2
.github/workflows/crater.yaml
vendored
|
|
@ -12,7 +12,7 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
crater:
|
crater:
|
||||||
env:
|
env:
|
||||||
SIXTYFPS_NO_QT: 1
|
SLINT_NO_QT: 1
|
||||||
CARGO_INCREMENTAL: false
|
CARGO_INCREMENTAL: false
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
strategy:
|
strategy:
|
||||||
|
|
|
||||||
2
.github/workflows/embedded_build.yaml
vendored
2
.github/workflows/embedded_build.yaml
vendored
|
|
@ -16,7 +16,7 @@ jobs:
|
||||||
- aarch64-unknown-linux-gnu
|
- aarch64-unknown-linux-gnu
|
||||||
- riscv64gc-unknown-linux-gnu
|
- riscv64gc-unknown-linux-gnu
|
||||||
env:
|
env:
|
||||||
SIXTYFPS_NO_QT: 1
|
SLINT_NO_QT: 1
|
||||||
SIXTYFPS_STYLE: fluent
|
SIXTYFPS_STYLE: fluent
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
|
||||||
8
.github/workflows/nightly_snapshot.yaml
vendored
8
.github/workflows/nightly_snapshot.yaml
vendored
|
|
@ -41,7 +41,7 @@ jobs:
|
||||||
|
|
||||||
build_vscode_lsp_linux_windows:
|
build_vscode_lsp_linux_windows:
|
||||||
env:
|
env:
|
||||||
SIXTYFPS_NO_QT: 1
|
SLINT_NO_QT: 1
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
|
|
@ -85,7 +85,7 @@ jobs:
|
||||||
|
|
||||||
build_vscode_lsp_macos_x86_64:
|
build_vscode_lsp_macos_x86_64:
|
||||||
env:
|
env:
|
||||||
SIXTYFPS_NO_QT: 1
|
SLINT_NO_QT: 1
|
||||||
runs-on: macOS-11
|
runs-on: macOS-11
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -112,7 +112,7 @@ jobs:
|
||||||
|
|
||||||
build_vscode_lsp_macos_aarch64:
|
build_vscode_lsp_macos_aarch64:
|
||||||
env:
|
env:
|
||||||
SIXTYFPS_NO_QT: 1
|
SLINT_NO_QT: 1
|
||||||
runs-on: macOS-11
|
runs-on: macOS-11
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
@ -162,7 +162,7 @@ jobs:
|
||||||
|
|
||||||
build_vscode_cross_linux_lsp:
|
build_vscode_cross_linux_lsp:
|
||||||
env:
|
env:
|
||||||
SIXTYFPS_NO_QT: 1
|
SLINT_NO_QT: 1
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
target:
|
target:
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@ include(CTest)
|
||||||
|
|
||||||
add_subdirectory(api/cpp/)
|
add_subdirectory(api/cpp/)
|
||||||
|
|
||||||
option(SIXTYFPS_BUILD_EXAMPLES "Build SixtyFPS Examples" OFF)
|
option(SLINT_BUILD_EXAMPLES "Build SixtyFPS Examples" OFF)
|
||||||
add_feature_info(SIXTYFPS_BUILD_EXAMPLES SIXTYFPS_BUILD_EXAMPLES "configure whether to build the examples")
|
add_feature_info(SLINT_BUILD_EXAMPLES SLINT_BUILD_EXAMPLES "configure whether to build the examples")
|
||||||
|
|
||||||
if(SIXTYFPS_BUILD_EXAMPLES)
|
if(SLINT_BUILD_EXAMPLES)
|
||||||
# Place all compiled examples into the same bin directory
|
# Place all compiled examples into the same bin directory
|
||||||
# on Windows, where we'll also put the dll
|
# on Windows, where we'll also put the dll
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ image = "ghcr.io/sixtyfpsui/sixtyfps/riscv64gc-unknown-linux-gnu"
|
||||||
|
|
||||||
[build.env]
|
[build.env]
|
||||||
passthrough = [
|
passthrough = [
|
||||||
"SIXTYFPS_NO_QT",
|
"SLINT_NO_QT",
|
||||||
"SIXTYFPS_STYLE",
|
"SIXTYFPS_STYLE",
|
||||||
"SIXTYFPS_TEST_FILTER",
|
"SIXTYFPS_TEST_FILTER",
|
||||||
"SIXTYFPS_INTERPRETER_ERROR_WHITELIST",
|
"SIXTYFPS_INTERPRETER_ERROR_WHITELIST",
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ set_property(
|
||||||
TARGET slint-cpp
|
TARGET slint-cpp
|
||||||
APPEND
|
APPEND
|
||||||
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
||||||
SIXTYFPS_GENERATED_INCLUDE_DIR="${CMAKE_CURRENT_BINARY_DIR}/generated_include/"
|
SLINT_GENERATED_INCLUDE_DIR="${CMAKE_CURRENT_BINARY_DIR}/generated_include/"
|
||||||
)
|
)
|
||||||
|
|
||||||
set_property(
|
set_property(
|
||||||
|
|
@ -33,16 +33,16 @@ set_property(
|
||||||
PROPERTY CORROSION_USE_HOST_BUILD 1
|
PROPERTY CORROSION_USE_HOST_BUILD 1
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(SixtyFPS INTERFACE)
|
add_library(Slint INTERFACE)
|
||||||
add_library(SixtyFPS::SixtyFPS ALIAS SixtyFPS)
|
add_library(Slint::Slint ALIAS Slint)
|
||||||
target_link_libraries(SixtyFPS INTERFACE slint-cpp)
|
target_link_libraries(Slint INTERFACE slint-cpp)
|
||||||
target_compile_features(SixtyFPS INTERFACE cxx_std_20)
|
target_compile_features(Slint INTERFACE cxx_std_20)
|
||||||
|
|
||||||
function(define_cargo_feature cargo-feature description default)
|
function(define_cargo_feature cargo-feature description default)
|
||||||
# turn foo-bar into SIXTYFPS_FEATURE_FOO_BAR
|
# 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}")
|
string(REPLACE "-" "_" cmake_option "${cmake_option}")
|
||||||
set(cmake_option "SIXTYFPS_FEATURE_${cmake_option}")
|
set(cmake_option "SLINT_FEATURE_${cmake_option}")
|
||||||
option("${cmake_option}" "${description}" ${default})
|
option("${cmake_option}" "${description}" ${default})
|
||||||
if(${cmake_option})
|
if(${cmake_option})
|
||||||
list(APPEND features ${cargo-feature})
|
list(APPEND features ${cargo-feature})
|
||||||
|
|
@ -52,10 +52,10 @@ function(define_cargo_feature cargo-feature description default)
|
||||||
endfunction()
|
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 SIXTYFPS_FEATURE_FOO_BAR
|
# 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}")
|
string(REPLACE "-" "_" cmake_option "${cmake_option}")
|
||||||
set(cmake_option "SIXTYFPS_FEATURE_${cmake_option}")
|
set(cmake_option "SLINT_FEATURE_${cmake_option}")
|
||||||
cmake_dependent_option("${cmake_option}" "${description}" ${default} ${depends_condition} OFF)
|
cmake_dependent_option("${cmake_option}" "${description}" ${default} ${depends_condition} OFF)
|
||||||
if(${cmake_option})
|
if(${cmake_option})
|
||||||
list(APPEND features ${cargo-feature})
|
list(APPEND features ${cargo-feature})
|
||||||
|
|
@ -66,11 +66,11 @@ endfunction()
|
||||||
|
|
||||||
# Features that are mapped to features in the Rust crate. These and their
|
# Features that are mapped to features in the Rust crate. These and their
|
||||||
# defaults need to be kept in sync with the Rust bit.
|
# defaults need to be kept in sync with the Rust bit.
|
||||||
define_cargo_feature(interpreter "Enable support for the SixtyFPS interpeter to load .60 files at run-time" ON)
|
define_cargo_feature(interpreter "Enable support for the Slint interpeter to load .60 files at run-time" ON)
|
||||||
|
|
||||||
define_cargo_feature(backend-gl "Enable OpenGL ES 2.0 based rendering backend" ON)
|
define_cargo_feature(backend-gl "Enable OpenGL ES 2.0 based rendering backend" ON)
|
||||||
define_cargo_dependent_feature(x11 "Enable X11 support when using GL backend" ON SIXTYFPS_FEATURE_BACKEND_GL OFF)
|
define_cargo_dependent_feature(x11 "Enable X11 support when using GL backend" ON SLINT_FEATURE_BACKEND_GL OFF)
|
||||||
define_cargo_dependent_feature(wayland "Enable Wayland support when using the GL backend" OFF SIXTYFPS_FEATURE_BACKEND_GL OFF)
|
define_cargo_dependent_feature(wayland "Enable Wayland support when using the GL backend" OFF SLINT_FEATURE_BACKEND_GL OFF)
|
||||||
|
|
||||||
define_cargo_feature(backend-qt "Enable Qt based rendering backend" ON)
|
define_cargo_feature(backend-qt "Enable Qt based rendering backend" ON)
|
||||||
|
|
||||||
|
|
@ -86,14 +86,14 @@ set_property(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
if (SIXTYFPS_FEATURE_BACKEND_QT)
|
if (SLINT_FEATURE_BACKEND_QT)
|
||||||
# For the CMake build don't rely on qmake being in PATH but use CMake to locate Qt. This
|
# For the CMake build don't rely on qmake being in PATH but use CMake to locate Qt. This
|
||||||
# means usually CMAKE_PREFIX_PATH is set.
|
# means usually CMAKE_PREFIX_PATH is set.
|
||||||
find_package(Qt6 6.0 QUIET COMPONENTS Core Widgets)
|
find_package(Qt6 6.0 QUIET COMPONENTS Core Widgets)
|
||||||
if (NOT TARGET Qt::qmake)
|
if (NOT TARGET Qt::qmake)
|
||||||
find_package(Qt5 5.15 QUIET COMPONENTS Core Widgets)
|
find_package(Qt5 5.15 QUIET COMPONENTS Core Widgets)
|
||||||
endif()
|
endif()
|
||||||
endif (SIXTYFPS_FEATURE_BACKEND_QT)
|
endif (SLINT_FEATURE_BACKEND_QT)
|
||||||
if (TARGET Qt::qmake)
|
if (TARGET Qt::qmake)
|
||||||
set_property(
|
set_property(
|
||||||
TARGET slint-cpp
|
TARGET slint-cpp
|
||||||
|
|
@ -101,24 +101,24 @@ if (TARGET Qt::qmake)
|
||||||
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
||||||
QMAKE=$<TARGET_PROPERTY:Qt::qmake,LOCATION>
|
QMAKE=$<TARGET_PROPERTY:Qt::qmake,LOCATION>
|
||||||
)
|
)
|
||||||
set(SIXTYFPS_STYLE_DEFAULT "native")
|
set(SLINT_STYLE_DEFAULT "native")
|
||||||
else()
|
else()
|
||||||
set_property(
|
set_property(
|
||||||
TARGET slint-cpp
|
TARGET slint-cpp
|
||||||
APPEND
|
APPEND
|
||||||
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
PROPERTY CORROSION_ENVIRONMENT_VARIABLES
|
||||||
SIXTYFPS_NO_QT=1
|
SLINT_NO_QT=1
|
||||||
)
|
)
|
||||||
set(SIXTYFPS_STYLE_DEFAULT "fluent")
|
set(SLINT_STYLE_DEFAULT "fluent")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(SIXTYFPS_STYLE ${SIXTYFPS_STYLE_DEFAULT} CACHE STRING "The SixtyFPS widget style" FORCE)
|
set(SLINT_STYLE ${SLINT_STYLE_DEFAULT} CACHE STRING "The Slint widget style" FORCE)
|
||||||
|
|
||||||
file(GLOB api_headers RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/include/"
|
file(GLOB api_headers RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/include/"
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
|
"${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
|
||||||
|
|
||||||
foreach(header IN LISTS api_headers)
|
foreach(header IN LISTS api_headers)
|
||||||
set_property(TARGET SixtyFPS APPEND PROPERTY PUBLIC_HEADER include/${header})
|
set_property(TARGET Slint APPEND PROPERTY PUBLIC_HEADER include/${header})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
set(generated_headers
|
set(generated_headers
|
||||||
|
|
@ -138,23 +138,23 @@ set(generated_headers
|
||||||
)
|
)
|
||||||
|
|
||||||
foreach(header IN LISTS generated_headers)
|
foreach(header IN LISTS generated_headers)
|
||||||
set_property(TARGET SixtyFPS APPEND PROPERTY PUBLIC_HEADER ${header})
|
set_property(TARGET Slint APPEND PROPERTY PUBLIC_HEADER ${header})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
target_include_directories(SixtyFPS INTERFACE
|
target_include_directories(Slint INTERFACE
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated_include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/generated_include>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
$<INSTALL_INTERFACE:include/sixtyfps>
|
$<INSTALL_INTERFACE:include/slint>
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(SixtyFPS::slint-compiler ALIAS slint-compiler)
|
add_executable(Slint::slint-compiler ALIAS slint-compiler)
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/SixtyFPSMacro.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/cmake/SlintMacro.cmake)
|
||||||
|
|
||||||
export(TARGETS SixtyFPS slint-cpp
|
export(TARGETS Slint slint-cpp
|
||||||
NAMESPACE SixtyFPS:: FILE "${CMAKE_BINARY_DIR}/lib/cmake/SixtyFPS/SixtyFPSTargets.cmake")
|
NAMESPACE Slint:: FILE "${CMAKE_BINARY_DIR}/lib/cmake/Slint/SlintTargets.cmake")
|
||||||
install(EXPORT SixtyFPSTargets NAMESPACE SixtyFPS:: DESTINATION lib/cmake/SixtyFPS)
|
install(EXPORT SlintTargets NAMESPACE Slint:: DESTINATION lib/cmake/Slint)
|
||||||
install(TARGETS SixtyFPS slint-cpp
|
install(TARGETS Slint slint-cpp
|
||||||
EXPORT SixtyFPSTargets LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include/sixtyfps)
|
EXPORT SlintTargets LIBRARY DESTINATION lib PUBLIC_HEADER DESTINATION include/slint)
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
@ -168,7 +168,7 @@ if(WIN32)
|
||||||
if(GENERATOR_IS_MULTI_CONFIG)
|
if(GENERATOR_IS_MULTI_CONFIG)
|
||||||
set(config_subdir_genex "$<CONFIG>/")
|
set(config_subdir_genex "$<CONFIG>/")
|
||||||
endif()
|
endif()
|
||||||
add_custom_target(SixtyFPS_dll_convenience ALL DEPENDS slint-cpp-shared
|
add_custom_target(Slint_dll_convenience ALL DEPENDS slint-cpp-shared
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
$<TARGET_FILE:slint-cpp-shared>
|
$<TARGET_FILE:slint-cpp-shared>
|
||||||
${CMAKE_BINARY_DIR}/bin/${config_subdir_genex}$<TARGET_FILE_NAME:slint-cpp-shared>)
|
${CMAKE_BINARY_DIR}/bin/${config_subdir_genex}$<TARGET_FILE_NAME:slint-cpp-shared>)
|
||||||
|
|
@ -176,7 +176,7 @@ endif()
|
||||||
|
|
||||||
install(PROGRAMS $<TARGET_FILE:slint-compiler> TYPE BIN)
|
install(PROGRAMS $<TARGET_FILE:slint-compiler> TYPE BIN)
|
||||||
|
|
||||||
set(SIXTYFPS_LIB_PROPERTIES "")
|
set(SLINT_LIB_PROPERTIES "")
|
||||||
foreach(prop
|
foreach(prop
|
||||||
IMPORTED_LOCATION IMPORTED_LOCATION_DEBUG IMPORTED_LOCATION_RELEASE
|
IMPORTED_LOCATION IMPORTED_LOCATION_DEBUG IMPORTED_LOCATION_RELEASE
|
||||||
IMPORTED_LOCATION_RELWITHDEBINFO IMPORTED_LOCATION_MINSIZEREL
|
IMPORTED_LOCATION_RELWITHDEBINFO IMPORTED_LOCATION_MINSIZEREL
|
||||||
|
|
@ -185,29 +185,29 @@ foreach(prop
|
||||||
get_target_property(value slint-cpp-shared ${prop})
|
get_target_property(value slint-cpp-shared ${prop})
|
||||||
if(value)
|
if(value)
|
||||||
get_filename_component(value ${value} NAME)
|
get_filename_component(value ${value} NAME)
|
||||||
list(APPEND SIXTYFPS_LIB_PROPERTIES ${prop} "\${_IMPORT_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${value}")
|
list(APPEND SLINT_LIB_PROPERTIES ${prop} "\${_IMPORT_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${value}")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
configure_package_config_file("cmake/SixtyFPSConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SixtyFPS/SixtyFPSConfig.cmake" INSTALL_DESTINATION lib/cmake/SixtyFPS)
|
configure_package_config_file("cmake/SlintConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Slint/SlintConfig.cmake" INSTALL_DESTINATION lib/cmake/Slint)
|
||||||
|
|
||||||
write_basic_package_version_file(
|
write_basic_package_version_file(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SixtyFPS/SixtyFPSConfigVersion.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Slint/SlintConfigVersion.cmake
|
||||||
VERSION 0.2.0
|
VERSION 0.2.0
|
||||||
COMPATIBILITY SameMinorVersion
|
COMPATIBILITY SameMinorVersion
|
||||||
)
|
)
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SixtyFPS/SixtyFPSConfig.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Slint/SlintConfig.cmake"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/SixtyFPS/SixtyFPSConfigVersion.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/Slint/SlintConfigVersion.cmake"
|
||||||
"${CMAKE_CURRENT_LIST_DIR}/cmake/SixtyFPSMacro.cmake"
|
"${CMAKE_CURRENT_LIST_DIR}/cmake/SlintMacro.cmake"
|
||||||
DESTINATION lib/cmake/SixtyFPS
|
DESTINATION lib/cmake/Slint
|
||||||
)
|
)
|
||||||
|
|
||||||
option(SIXTYFPS_PACKAGE_BUNDLE_QT "Internal setting to install Qt binary in the packages" OFF)
|
option(SLINT_PACKAGE_BUNDLE_QT "Internal setting to install Qt binary in the packages" OFF)
|
||||||
if(SIXTYFPS_PACKAGE_BUNDLE_QT)
|
if(SLINT_PACKAGE_BUNDLE_QT)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
find_package(Qt6 6.0 COMPONENTS Core Gui Widgets Svg)
|
find_package(Qt6 6.0 COMPONENTS Core Gui Widgets Svg)
|
||||||
install(
|
install(
|
||||||
|
|
@ -234,9 +234,9 @@ if(SIXTYFPS_PACKAGE_BUNDLE_QT)
|
||||||
include(InstallRequiredSystemLibraries)
|
include(InstallRequiredSystemLibraries)
|
||||||
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} TYPE LIB)
|
install(FILES ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} TYPE LIB)
|
||||||
endif()
|
endif()
|
||||||
endif(SIXTYFPS_PACKAGE_BUNDLE_QT)
|
endif(SLINT_PACKAGE_BUNDLE_QT)
|
||||||
|
|
||||||
set(CPACK_PACKAGE_NAME "SixtyFPS-cpp")
|
set(CPACK_PACKAGE_NAME "Slint-cpp")
|
||||||
set(CPACK_PACKAGE_VENDOR "SixtyFPS")
|
set(CPACK_PACKAGE_VENDOR "SixtyFPS")
|
||||||
set(CPACK_VERBATIM_VARIABLES true)
|
set(CPACK_VERBATIM_VARIABLES true)
|
||||||
set(CPACK_PACKAGE_VERSION_MAJOR 0)
|
set(CPACK_PACKAGE_VERSION_MAJOR 0)
|
||||||
|
|
@ -264,9 +264,9 @@ if(BUILD_TESTING)
|
||||||
|
|
||||||
find_package(Threads REQUIRED)
|
find_package(Threads REQUIRED)
|
||||||
|
|
||||||
macro(sixtyfps_test NAME)
|
macro(slint_test NAME)
|
||||||
add_executable(test_${NAME} tests/${NAME}.cpp)
|
add_executable(test_${NAME} tests/${NAME}.cpp)
|
||||||
target_link_libraries(test_${NAME} PRIVATE SixtyFPS Catch2::Catch2)
|
target_link_libraries(test_${NAME} PRIVATE Slint Catch2::Catch2)
|
||||||
target_compile_definitions(test_${NAME} PRIVATE
|
target_compile_definitions(test_${NAME} PRIVATE
|
||||||
SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\"
|
SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}/\"
|
||||||
)
|
)
|
||||||
|
|
@ -286,11 +286,11 @@ if(BUILD_TESTING)
|
||||||
target_compile_options(test_${NAME} PRIVATE -Wno-maybe-uninitialized)
|
target_compile_options(test_${NAME} PRIVATE -Wno-maybe-uninitialized)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
endmacro(sixtyfps_test)
|
endmacro(slint_test)
|
||||||
sixtyfps_test(datastructures)
|
slint_test(datastructures)
|
||||||
if(SIXTYFPS_FEATURE_INTERPRETER)
|
if(SLINT_FEATURE_INTERPRETER)
|
||||||
sixtyfps_test(interpreter)
|
slint_test(interpreter)
|
||||||
endif()
|
endif()
|
||||||
sixtyfps_test(eventloop)
|
slint_test(eventloop)
|
||||||
target_link_libraries(test_eventloop PRIVATE Threads::Threads)
|
target_link_libraries(test_eventloop PRIVATE Threads::Threads)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ FetchContent_MakeAvailable(SixtyFPS)
|
||||||
```
|
```
|
||||||
|
|
||||||
If you prefer to treat SixtyFPS as an external CMake package, then you can also build SixtyFPS from source like a regular
|
If you prefer to treat SixtyFPS as an external CMake package, then you can also build SixtyFPS from source like a regular
|
||||||
CMake project, install it into a prefix directory of your choice and use `find_package(SixtyFPS)` in your `CMakeLists.txt`.
|
CMake project, install it into a prefix directory of your choice and use `find_package(Slint)` in your `CMakeLists.txt`.
|
||||||
|
|
||||||
#### Cross-compiling
|
#### Cross-compiling
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ You can download one of our pre-built binaries for Linux or Windows on x86-64 ar
|
||||||
4. Uncompress the downloaded archive or run the installer.
|
4. Uncompress the downloaded archive or run the installer.
|
||||||
|
|
||||||
|
|
||||||
After extracting the artifact or running the installer, you can place the `lib` sub-directory into your `CMAKE_PREFIX_PATH` and `find_package(SixtyFPS)` should succeed in locating the package.
|
After extracting the artifact or running the installer, you can place the `lib` sub-directory into your `CMAKE_PREFIX_PATH` and `find_package(Slint)` should succeed in locating the package.
|
||||||
|
|
||||||
## Usage via CMake
|
## Usage via CMake
|
||||||
|
|
||||||
|
|
@ -106,7 +106,7 @@ A typical example looks like this:
|
||||||
cmake_minimum_required(VERSION 3.19)
|
cmake_minimum_required(VERSION 3.19)
|
||||||
project(my_application LANGUAGES CXX)
|
project(my_application LANGUAGES CXX)
|
||||||
|
|
||||||
# Note: Use find_package(SixtyFPS) instead of the following three commands, if you prefer the package
|
# Note: Use find_package(Slint) instead of the following three commands, if you prefer the package
|
||||||
# approach.
|
# approach.
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
|
|
@ -118,12 +118,12 @@ FetchContent_Declare(
|
||||||
FetchContent_MakeAvailable(SixtyFPS)
|
FetchContent_MakeAvailable(SixtyFPS)
|
||||||
|
|
||||||
add_executable(my_application main.cpp)
|
add_executable(my_application main.cpp)
|
||||||
target_link_libraries(my_application PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(my_application PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(my_application my_application_ui.60)
|
slint_target_sources(my_application my_application_ui.60)
|
||||||
```
|
```
|
||||||
|
|
||||||
The `sixtyfps_target_60_sources` cmake command allows you to add .60 files to your build. Finally it is
|
The `slint_target_sources` cmake command allows you to add .60 files to your build. Finally it is
|
||||||
necessary to link your executable or library against the `SixtyFPS::SixtyFPS` target.
|
necessary to link your executable or library against the `Slint::Slint` target.
|
||||||
|
|
||||||
## Tutorial
|
## Tutorial
|
||||||
|
|
||||||
|
|
@ -182,7 +182,7 @@ slint-compiler my_application_ui.60 > my_application_ui.h
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: You would usually not type this command yourself, this is done automatically by the build system.
|
Note: You would usually not type this command yourself, this is done automatically by the build system.
|
||||||
(that's what the `sixtyfps_target_60_sources` cmake function does)
|
(that's what the `slint_target_sources` cmake function does)
|
||||||
|
|
||||||
This will generate a `my_application_ui.h` header file. It basically contains the following code
|
This will generate a `my_application_ui.h` header file. It basically contains the following code
|
||||||
(edited for brevity)
|
(edited for brevity)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ fn main() -> Result<(), anyhow::Error> {
|
||||||
manifest_dir.to_string_lossy()
|
manifest_dir.to_string_lossy()
|
||||||
));
|
));
|
||||||
|
|
||||||
let output_dir = std::env::var_os("SIXTYFPS_GENERATED_INCLUDE_DIR").unwrap_or_else(|| {
|
let output_dir = std::env::var_os("SLINT_GENERATED_INCLUDE_DIR").unwrap_or_else(|| {
|
||||||
Path::new(&std::env::var_os("OUT_DIR").unwrap()).join("generated_include").into()
|
Path::new(&std::env::var_os("OUT_DIR").unwrap()).join("generated_include").into()
|
||||||
});
|
});
|
||||||
let output_dir = Path::new(&output_dir);
|
let output_dir = Path::new(&output_dir);
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ if(_IMPORT_PREFIX STREQUAL "/")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(slint-cpp-shared SHARED IMPORTED)
|
add_library(slint-cpp-shared SHARED IMPORTED)
|
||||||
set_target_properties(slint-cpp-shared PROPERTIES @SIXTYFPS_LIB_PROPERTIES@)
|
set_target_properties(slint-cpp-shared PROPERTIES @SLINT_LIB_PROPERTIES@)
|
||||||
|
|
||||||
add_executable(SixtyFPS::slint-compiler IMPORTED GLOBAL)
|
add_executable(Slint::slint-compiler IMPORTED GLOBAL)
|
||||||
set_target_properties(SixtyFPS::slint-compiler PROPERTIES IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_BINDIR@/slint-compiler${CMAKE_EXECUTABLE_SUFFIX}")
|
set_target_properties(Slint::slint-compiler PROPERTIES IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_BINDIR@/slint-compiler${CMAKE_EXECUTABLE_SUFFIX}")
|
||||||
|
|
||||||
set(_IMPORT_PREFIX)
|
set(_IMPORT_PREFIX)
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/SixtyFPSTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/SlintTargets.cmake")
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/SixtyFPSMacro.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/SlintMacro.cmake")
|
||||||
|
|
||||||
set(SIXTYFPS_STYLE @SIXTYFPS_STYLE_DEFAULT@ CACHE STRING "The SixtyFPS widget style")
|
set(SLINT_STYLE @SLINT_STYLE_DEFAULT@ CACHE STRING "The Slint widget style")
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright © SixtyFPS GmbH <info@sixtyfps.io>
|
# Copyright © SixtyFPS GmbH <info@sixtyfps.io>
|
||||||
# SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
|
# SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
|
||||||
|
|
||||||
function(SIXTYFPS_TARGET_60_SOURCES target)
|
function(SLINT_TARGET_SOURCES target)
|
||||||
foreach (it IN ITEMS ${ARGN})
|
foreach (it IN ITEMS ${ARGN})
|
||||||
get_filename_component(_60_BASE_NAME ${it} NAME_WE)
|
get_filename_component(_60_BASE_NAME ${it} NAME_WE)
|
||||||
get_filename_component(_60_ABSOLUTE ${it} REALPATH BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
get_filename_component(_60_ABSOLUTE ${it} REALPATH BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
@ -14,10 +14,10 @@ function(SIXTYFPS_TARGET_60_SOURCES target)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
|
||||||
COMMAND SixtyFPS::slint-compiler ${_60_ABSOLUTE}
|
COMMAND Slint::slint-compiler ${_60_ABSOLUTE}
|
||||||
-o ${_60_BASE_NAME_REL}.h --depfile ${_60_BASE_NAME_REL}.d
|
-o ${_60_BASE_NAME_REL}.h --depfile ${_60_BASE_NAME_REL}.d
|
||||||
--style ${SIXTYFPS_STYLE}
|
--style ${SLINT_STYLE}
|
||||||
DEPENDS SixtyFPS::slint-compiler ${_60_ABSOLUTE}
|
DEPENDS Slint::slint-compiler ${_60_ABSOLUTE}
|
||||||
COMMENT "Generating ${_60_BASE_NAME}.h"
|
COMMENT "Generating ${_60_BASE_NAME}.h"
|
||||||
DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.d
|
DEPFILE ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.d
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||||
|
|
@ -27,10 +27,10 @@ function(SIXTYFPS_TARGET_60_SOURCES target)
|
||||||
file(GLOB ALL_60S "${_60_DIR}/*.60")
|
file(GLOB ALL_60S "${_60_DIR}/*.60")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
|
||||||
COMMAND SixtyFPS::slint-compiler ${_60_ABSOLUTE}
|
COMMAND Slint::slint-compiler ${_60_ABSOLUTE}
|
||||||
-o ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
|
-o ${CMAKE_CURRENT_BINARY_DIR}/${_60_BASE_NAME}.h
|
||||||
--style ${SIXTYFPS_STYLE}
|
--style ${SLINT_STYLE}
|
||||||
DEPENDS SixtyFPS::slint-compiler ${_60_ABSOLUTE} ${ALL_60S}
|
DEPENDS Slint::slint-compiler ${_60_ABSOLUTE} ${ALL_60S}
|
||||||
COMMENT "Generating ${_60_BASE_NAME}.h"
|
COMMENT "Generating ${_60_BASE_NAME}.h"
|
||||||
)
|
)
|
||||||
endif(CMAKE_GENERATOR STREQUAL "Ninja")
|
endif(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||||
|
|
@ -18,7 +18,7 @@ You can download one of our pre-built binaries for Linux or Windows on x86-64 ar
|
||||||
or `sixtyfps-cpp-XXX-win64.exe` for a Windows installer. ("XXX" refers to the version of the latest release)
|
or `sixtyfps-cpp-XXX-win64.exe` for a Windows installer. ("XXX" refers to the version of the latest release)
|
||||||
4. Uncompress the downloaded archive or run the installer.
|
4. Uncompress the downloaded archive or run the installer.
|
||||||
|
|
||||||
After extracting the artifact or running the installer, you can place the `lib` sub-directory into your `CMAKE_PREFIX_PATH` and `find_package(SixtyFPS)` should succeed in locating the package.
|
After extracting the artifact or running the installer, you can place the `lib` sub-directory into your `CMAKE_PREFIX_PATH` and `find_package(Slint)` should succeed in locating the package.
|
||||||
|
|
||||||
In the next section you will learn how to use the installed library in your application
|
In the next section you will learn how to use the installed library in your application
|
||||||
and load `.60` UI files.
|
and load `.60` UI files.
|
||||||
|
|
@ -50,7 +50,7 @@ FetchContent_MakeAvailable(SixtyFPS)
|
||||||
```
|
```
|
||||||
|
|
||||||
If you prefer to treat SixtyFPS as an external CMake package, then you can also build SixtyFPS from source like a regular
|
If you prefer to treat SixtyFPS as an external CMake package, then you can also build SixtyFPS from source like a regular
|
||||||
CMake project, install it into a prefix directory of your choice and use `find_package(SixtyFPS)` in your `CMakeLists.txt`.
|
CMake project, install it into a prefix directory of your choice and use `find_package(Slint)` in your `CMakeLists.txt`.
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
|
|
@ -58,11 +58,11 @@ The SixtyFPS run-time library supports different features that can be toggled. Y
|
||||||
not enabled by default but that is revelant for you, or you may want to disable a feature that you know you do not need and
|
not enabled by default but that is revelant for you, or you may want to disable a feature that you know you do not need and
|
||||||
therefore reduce the size of the resulting library.
|
therefore reduce the size of the resulting library.
|
||||||
|
|
||||||
The CMake configure step offers CMake options for various feature that are all prefixed with `SIXTYFPS_FEATURE_`. For example
|
The CMake configure step offers CMake options for various feature that are all prefixed with `SLINT_FEATURE_`. For example
|
||||||
you can enable support for the Wayland windowing system on Linux by enabling the `SIXTYFPS_FEATURE_WAYLAND` feature. There are
|
you can enable support for the Wayland windowing system on Linux by enabling the `SLINT_FEATURE_WAYLAND` feature. There are
|
||||||
different ways of toggling CMake options. For example on the command line using the `-D` parameter:
|
different ways of toggling CMake options. For example on the command line using the `-D` parameter:
|
||||||
|
|
||||||
`cmake -DSIXTYFPS_FEATURE_WAYLAND=ON ...`
|
`cmake -DSLINT_FEATURE_WAYLAND=ON ...`
|
||||||
|
|
||||||
Alternatively, after the configure step you can use `cmake-gui` or `ccmake` on the build directory for a list of all features
|
Alternatively, after the configure step you can use `cmake-gui` or `ccmake` on the build directory for a list of all features
|
||||||
and their description.
|
and their description.
|
||||||
|
|
|
||||||
|
|
@ -58,3 +58,12 @@ instance->invoke_callback("foo", args);
|
||||||
#### Models
|
#### Models
|
||||||
|
|
||||||
The `Value::Type::Array` has been replaced by `Value::Type::Model`
|
The `Value::Type::Array` has been replaced by `Value::Type::Model`
|
||||||
|
|
||||||
|
|
||||||
|
### CMake Interface
|
||||||
|
|
||||||
|
The CMake interface has changed mostly in terms of renaming `SixtyFPS` to `Slint`:
|
||||||
|
|
||||||
|
* `find_package(SixtyFPS)` becomes `find_package(Slint)`.
|
||||||
|
* The `SixtyFPS::SixtyFPS` CMake target was renamed to `Slint::Slint`.
|
||||||
|
* The `sixtyfps_target_60_sources` CMake command was renamed to `slint_target_sources`.
|
||||||
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
Once SixtyFPS is built, you can use it in your CMake application or library target in two steps:
|
Once SixtyFPS is built, you can use it in your CMake application or library target in two steps:
|
||||||
|
|
||||||
1. Associate the `.60` files that you'd like to use by calling the `sixtyfps_target_60_sources` cmake command. The first parameter is
|
1. Associate the `.60` files that you'd like to use by calling the `slint_target_sources` cmake command. The first parameter is
|
||||||
your application (or library) CMake target, and the parameters following are the names of the `.60` files. This will result in the
|
your application (or library) CMake target, and the parameters following are the names of the `.60` files. This will result in the
|
||||||
`.60` files to be compiled into C++ source code.
|
`.60` files to be compiled into C++ source code.
|
||||||
2. The generated C++ source code also needs the SixtyFPS run-time library. This dependency is satisfied by linking `SixtyFPS::SixtyFPS`
|
2. The generated C++ source code also needs the SixtyFPS run-time library. This dependency is satisfied by linking `Slint::Slint`
|
||||||
into your target with the `target_link_libraries` command.
|
into your target with the `target_link_libraries` command.
|
||||||
|
|
||||||
A typical example looks like this:
|
A typical example looks like this:
|
||||||
|
|
@ -14,7 +14,7 @@ A typical example looks like this:
|
||||||
cmake_minimum_required(VERSION 3.19)
|
cmake_minimum_required(VERSION 3.19)
|
||||||
project(my_application LANGUAGES CXX)
|
project(my_application LANGUAGES CXX)
|
||||||
|
|
||||||
# Note: Use find_package(SixtyFPS) instead of the following three commands,
|
# Note: Use find_package(Slint) instead of the following three commands,
|
||||||
# if you prefer the package approach.
|
# if you prefer the package approach.
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
|
|
@ -26,8 +26,8 @@ FetchContent_Declare(
|
||||||
FetchContent_MakeAvailable(SixtyFPS)
|
FetchContent_MakeAvailable(SixtyFPS)
|
||||||
|
|
||||||
add_executable(my_application main.cpp)
|
add_executable(my_application main.cpp)
|
||||||
sixtyfps_target_60_sources(my_application my_application_ui.60)
|
slint_target_sources(my_application my_application_ui.60)
|
||||||
target_link_libraries(my_application PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(my_application PRIVATE Slint::Slint)
|
||||||
```
|
```
|
||||||
|
|
||||||
Suppose `my_application_ui.60` was a "Hello World" like this:
|
Suppose `my_application_ui.60` was a "Hello World" like this:
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ data models or setting up callbacks that are invoked when the user activates cer
|
||||||
You can choose to compile a `.60` file to C++, which provides the best performance
|
You can choose to compile a `.60` file to C++, which provides the best performance
|
||||||
and lowest memory consumption.
|
and lowest memory consumption.
|
||||||
|
|
||||||
The `sixtyfps_target_60_sources` cmake command makes the translation automatic
|
The `slint_target_sources` cmake command makes the translation automatic
|
||||||
and [generated code](generated_code.md) has an API that allows setting and getting
|
and [generated code](generated_code.md) has an API that allows setting and getting
|
||||||
property values, etc. That API will use types from the {ref}`sixtyfps <namespace_sixtyfps>`
|
property values, etc. That API will use types from the {ref}`sixtyfps <namespace_sixtyfps>`
|
||||||
namespace, for example {cpp:class}`sixtyfps::SharedString` or {cpp:class}`sixtyfps::Color`.
|
namespace, for example {cpp:class}`sixtyfps::SharedString` or {cpp:class}`sixtyfps::Color`.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Install Qt
|
# Install Qt
|
||||||
|
|
||||||
TLDR; If you are redirected to this document because of a link in the warning that Qt was not found and
|
TLDR; If you are redirected to this document because of a link in the warning that Qt was not found and
|
||||||
you want to silence the warning without installing Qt, you can set this environment variable: `SIXTYFPS_NO_QT=1`
|
you want to silence the warning without installing Qt, you can set this environment variable: `SLINT_NO_QT=1`
|
||||||
|
|
||||||
## Do I need Qt to use SixtyFPS?
|
## Do I need Qt to use SixtyFPS?
|
||||||
|
|
||||||
|
|
@ -47,5 +47,5 @@ environment variable, in order for the build system to locate `qmake` and to fin
|
||||||
|
|
||||||
## How To Disable the Qt Backend
|
## How To Disable the Qt Backend
|
||||||
|
|
||||||
By setting the `SIXTYFPS_NO_QT` environment variable when building SixtyFPS, the Qt backend will not be compiled and
|
By setting the `SLINT_NO_QT` environment variable when building SixtyFPS, the Qt backend will not be compiled and
|
||||||
no attempt will be made to find Qt on the system. This will also disable the warning stating that Qt was not found.
|
no attempt will be made to find Qt on the system. This will also disable the warning stating that Qt was not found.
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,18 @@
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(memory_tutorial_initial main_initial.cpp)
|
add_executable(memory_tutorial_initial main_initial.cpp)
|
||||||
target_link_libraries(memory_tutorial_initial PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(memory_tutorial_initial PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(memory_tutorial_initial memory.60)
|
slint_target_sources(memory_tutorial_initial memory.60)
|
||||||
|
|
||||||
add_executable(memory_tutorial_tiles_from_cpp main_tiles_from_cpp.cpp)
|
add_executable(memory_tutorial_tiles_from_cpp main_tiles_from_cpp.cpp)
|
||||||
target_link_libraries(memory_tutorial_tiles_from_cpp PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(memory_tutorial_tiles_from_cpp PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(memory_tutorial_tiles_from_cpp memory_tiles_from_cpp.60)
|
slint_target_sources(memory_tutorial_tiles_from_cpp memory_tiles_from_cpp.60)
|
||||||
|
|
||||||
add_executable(memory_tutorial_game_logic main_game_logic.cpp)
|
add_executable(memory_tutorial_game_logic main_game_logic.cpp)
|
||||||
target_link_libraries(memory_tutorial_game_logic PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(memory_tutorial_game_logic PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(memory_tutorial_game_logic memory_game_logic.60)
|
slint_target_sources(memory_tutorial_game_logic memory_game_logic.60)
|
||||||
|
|
|
||||||
|
|
@ -27,13 +27,13 @@ FetchContent_Declare(
|
||||||
FetchContent_MakeAvailable(SixtyFPS)
|
FetchContent_MakeAvailable(SixtyFPS)
|
||||||
|
|
||||||
add_executable(memory_game main.cpp)
|
add_executable(memory_game main.cpp)
|
||||||
target_link_libraries(memory_game PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(memory_game PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(memory_game memory.60)
|
slint_target_sources(memory_game memory.60)
|
||||||
```
|
```
|
||||||
|
|
||||||
This should look familiar to people familiar with CMake. We see that this CMakeLists.txt
|
This should look familiar to people familiar with CMake. We see that this CMakeLists.txt
|
||||||
references a `main.cpp`, which we will add later, and it also has a line
|
references a `main.cpp`, which we will add later, and it also has a line
|
||||||
`sixtyfps_target_60_sources(memory_game memory.60)`, which is a SixtyFPS function used to
|
`slint_target_sources(memory_game memory.60)`, which is a SixtyFPS function used to
|
||||||
add the `memory.60` file to the target. We must then create, in the same directory,
|
add the `memory.60` file to the target. We must then create, in the same directory,
|
||||||
the `memory.60` file. Let's just fill it with a hello world for now:
|
the `memory.60` file. Let's just fill it with a hello world for now:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,22 @@
|
||||||
cmake_minimum_required(VERSION 3.19)
|
cmake_minimum_required(VERSION 3.19)
|
||||||
project(SixtyFPSExamples LANGUAGES CXX)
|
project(SixtyFPSExamples LANGUAGES CXX)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_subdirectory(printerdemo/cpp/)
|
add_subdirectory(printerdemo/cpp/)
|
||||||
if (SIXTYFPS_FEATURE_INTERPRETER)
|
if (SLINT_FEATURE_INTERPRETER)
|
||||||
add_subdirectory(printerdemo/cpp_interpreted/)
|
add_subdirectory(printerdemo/cpp_interpreted/)
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(printerdemo_old/cpp/)
|
add_subdirectory(printerdemo_old/cpp/)
|
||||||
add_subdirectory(todo/cpp/)
|
add_subdirectory(todo/cpp/)
|
||||||
add_subdirectory(gallery/)
|
add_subdirectory(gallery/)
|
||||||
add_subdirectory(memory/)
|
add_subdirectory(memory/)
|
||||||
if (SIXTYFPS_FEATURE_INTERPRETER AND SIXTYFPS_FEATURE_BACKEND_QT)
|
if (SLINT_FEATURE_INTERPRETER AND SLINT_FEATURE_BACKEND_QT)
|
||||||
add_subdirectory(qt_viewer/)
|
add_subdirectory(qt_viewer/)
|
||||||
endif()
|
endif()
|
||||||
if (SIXTYFPS_FEATURE_INTERPRETER)
|
if (SLINT_FEATURE_INTERPRETER)
|
||||||
add_subdirectory(iot-dashboard/)
|
add_subdirectory(iot-dashboard/)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(sixtyfps_cpp_gallery LANGUAGES CXX)
|
project(sixtyfps_cpp_gallery LANGUAGES CXX)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(gallery main.cpp)
|
add_executable(gallery main.cpp)
|
||||||
target_link_libraries(gallery PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(gallery PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(gallery gallery.60)
|
slint_target_sources(gallery gallery.60)
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(sixtyfps_cpp_iot_dashboard LANGUAGES CXX)
|
project(sixtyfps_cpp_iot_dashboard LANGUAGES CXX)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
@ -19,4 +19,4 @@ add_executable(iot_dashboard main.cpp dashboard.cpp)
|
||||||
target_compile_definitions(iot_dashboard PRIVATE
|
target_compile_definitions(iot_dashboard PRIVATE
|
||||||
SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"
|
SOURCE_DIR=\"${CMAKE_CURRENT_SOURCE_DIR}\"
|
||||||
)
|
)
|
||||||
target_link_libraries(iot_dashboard PRIVATE SixtyFPS::SixtyFPS fmt::fmt )
|
target_link_libraries(iot_dashboard PRIVATE Slint::Slint fmt::fmt )
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,12 @@
|
||||||
cmake_minimum_required(VERSION 3.19)
|
cmake_minimum_required(VERSION 3.19)
|
||||||
project(memory LANGUAGES CXX)
|
project(memory LANGUAGES CXX)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Note, we can't name it simply "memory" because there is a C++ standard header with the same name
|
# Note, we can't name it simply "memory" because there is a C++ standard header with the same name
|
||||||
# so `#include<memory>` includes the generated binary when it exists
|
# so `#include<memory>` includes the generated binary when it exists
|
||||||
add_executable(memory_game memory.cpp)
|
add_executable(memory_game memory.cpp)
|
||||||
target_link_libraries(memory_game PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(memory_game PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(memory_game memory.60)
|
slint_target_sources(memory_game memory.60)
|
||||||
|
|
|
||||||
|
|
@ -4,13 +4,13 @@
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(sixtyfps_cpp_printer_demo LANGUAGES CXX)
|
project(sixtyfps_cpp_printer_demo LANGUAGES CXX)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(printerdemo main.cpp)
|
add_executable(printerdemo main.cpp)
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
target_compile_options(printerdemo PRIVATE /bigobj)
|
target_compile_options(printerdemo PRIVATE /bigobj)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(printerdemo PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(printerdemo PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(printerdemo ../ui/printerdemo.60)
|
slint_target_sources(printerdemo ../ui/printerdemo.60)
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(sixtyfps_cpp_interpreter_printer_demo LANGUAGES CXX)
|
project(sixtyfps_cpp_interpreter_printer_demo LANGUAGES CXX)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(printerdemo_interpreted main.cpp)
|
add_executable(printerdemo_interpreted main.cpp)
|
||||||
|
|
@ -15,4 +15,4 @@ target_compile_definitions(printerdemo_interpreted PRIVATE
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
target_compile_options(printerdemo_interpreted PRIVATE /bigobj)
|
target_compile_options(printerdemo_interpreted PRIVATE /bigobj)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(printerdemo_interpreted PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(printerdemo_interpreted PRIVATE Slint::Slint)
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(printerdemo_old main.cpp)
|
add_executable(printerdemo_old main.cpp)
|
||||||
target_link_libraries(printerdemo_old PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(printerdemo_old PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(printerdemo_old ../ui/printerdemo.60)
|
slint_target_sources(printerdemo_old ../ui/printerdemo.60)
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(qt_viewer LANGUAGES CXX)
|
project(qt_viewer LANGUAGES CXX)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
find_package(Qt6 6.0 COMPONENTS Core Widgets QUIET)
|
find_package(Qt6 6.0 COMPONENTS Core Widgets QUIET)
|
||||||
|
|
@ -16,5 +16,5 @@ endif()
|
||||||
if (TARGET Qt::Widgets)
|
if (TARGET Qt::Widgets)
|
||||||
set(CMAKE_AUTOUIC ON)
|
set(CMAKE_AUTOUIC ON)
|
||||||
add_executable(qt_viewer qt_viewer.cpp)
|
add_executable(qt_viewer qt_viewer.cpp)
|
||||||
target_link_libraries(qt_viewer PRIVATE SixtyFPS::SixtyFPS Qt::Core Qt::Widgets)
|
target_link_libraries(qt_viewer PRIVATE Slint::Slint Qt::Core Qt::Widgets)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@
|
||||||
cmake_minimum_required(VERSION 3.14)
|
cmake_minimum_required(VERSION 3.14)
|
||||||
project(sixtyfps_cpp_todo LANGUAGES CXX)
|
project(sixtyfps_cpp_todo LANGUAGES CXX)
|
||||||
|
|
||||||
if (NOT TARGET SixtyFPS::SixtyFPS)
|
if (NOT TARGET Slint::Slint)
|
||||||
find_package(SixtyFPS REQUIRED)
|
find_package(Slint REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(todo main.cpp)
|
add_executable(todo main.cpp)
|
||||||
target_link_libraries(todo PRIVATE SixtyFPS::SixtyFPS)
|
target_link_libraries(todo PRIVATE Slint::Slint)
|
||||||
sixtyfps_target_60_sources(todo ../ui/todo.60)
|
slint_target_sources(todo ../ui/todo.60)
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
// SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
|
// SPDX-License-Identifier: (GPL-3.0-only OR LicenseRef-SixtyFPS-commercial)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("cargo:rerun-if-env-changed=SIXTYFPS_NO_QT");
|
println!("cargo:rerun-if-env-changed=SLINT_NO_QT");
|
||||||
if std::env::var("TARGET").map_or(false, |t| t.starts_with("wasm"))
|
if std::env::var("TARGET").map_or(false, |t| t.starts_with("wasm"))
|
||||||
|| std::env::var("SIXTYFPS_NO_QT").is_ok()
|
|| std::env::var("SLINT_NO_QT").is_ok()
|
||||||
{
|
{
|
||||||
println!("cargo:rustc-cfg=no_qt");
|
println!("cargo:rustc-cfg=no_qt");
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ fn main() {
|
||||||
// The way this work is this
|
// The way this work is this
|
||||||
// 1. `qttypes`' crate's build script already detects Qt and set the DEP_QT_VERSION
|
// 1. `qttypes`' crate's build script already detects Qt and set the DEP_QT_VERSION
|
||||||
// 2. The qt rendering backend's build script will check if the qttype crates found Qt and
|
// 2. The qt rendering backend's build script will check if the qttype crates found Qt and
|
||||||
// look at the SIXTYFPS_NO_QT env variable, and sets the DEP_slint_backend_qt_internal_SUPPORTS_NATIVE_STYLE
|
// look at the SLINT_NO_QT env variable, and sets the DEP_slint_backend_qt_internal_SUPPORTS_NATIVE_STYLE
|
||||||
// env variable so that the default rendering backend can know if Qt was there.
|
// env variable so that the default rendering backend can know if Qt was there.
|
||||||
// 3. here, in the default rendering backend, we know if we depends on the qt backend and if it
|
// 3. here, in the default rendering backend, we know if we depends on the qt backend and if it
|
||||||
// has set the DEP_slint_backend_qt_internal_SUPPORTS_NATIVE_STYLE env variable.
|
// has set the DEP_slint_backend_qt_internal_SUPPORTS_NATIVE_STYLE env variable.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue