Skip to content

Commit

Permalink
WIP: cmake: use patched version of cxx-qt-cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
ahayzen-kdab committed Nov 18, 2024
1 parent 4bddf8e commit 19bd854
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- Build warnings due to unused unsafe blocks since CXX 1.0.130
- Build failures with WASM due to `cc` crate setting `-fno-exceptions` since 1.2.0

## [0.7.0](https://github.com/KDAB/cxx-qt/compare/v0.6.1...v0.7.0) - 2024-10-30

Expand Down
9 changes: 9 additions & 0 deletions book/src/concepts/wasm-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,12 @@ error[E0433]: failed to resolve: use of undeclared type `IovLen`
`socket2` is a dependency of `async-io`, which is a dependency of `async-std`.

There is discussion around supporting wasm in the GitHub repository for `async-std`, and the progress is being tracked [here](https://github.com/async-rs/async-std/issues/220).

### Cannot use throw / try catch with exceptions disabled

CXX and CXX-Qt can generate code that attempts to use exceptions but these are disabled
for most WASM platforms.

The cmake-qt-cmake builder will attempt to set a define of `RUST_CXX_NO_EXCEPTIONS` which should
causes the code not to be compiled. But if this doesn't work try adding `-DRUST_CXX_NO_EXCEPTIONS`
to a `CXXFLAGS` enviornment variable while building.
3 changes: 2 additions & 1 deletion examples/demo_threading/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ if(NOT CxxQt_FOUND)
FetchContent_Declare(
CxxQt
GIT_REPOSITORY https://github.com/kdab/cxx-qt-cmake.git
GIT_TAG main
GIT_TAG wasm-set-cxxflags
# GIT_TAG main
)

FetchContent_MakeAvailable(CxxQt)
Expand Down
3 changes: 2 additions & 1 deletion examples/qml_features/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ if(NOT CxxQt_FOUND)
FetchContent_Declare(
CxxQt
GIT_REPOSITORY https://github.com/kdab/cxx-qt-cmake.git
GIT_TAG main
GIT_TAG wasm-set-cxxflags
# GIT_TAG main
)

FetchContent_MakeAvailable(CxxQt)
Expand Down
3 changes: 2 additions & 1 deletion examples/qml_minimal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ if(NOT CxxQt_FOUND)
CxxQt
GIT_REPOSITORY https://github.com/kdab/cxx-qt-cmake.git
# ANCHOR_END: book_cmake_find_cxx_qt_start
GIT_TAG main
GIT_TAG wasm-set-cxxflags
# GIT_TAG main
# ANCHOR: book_cmake_find_cxx_qt_end
)

Expand Down
3 changes: 2 additions & 1 deletion tests/basic_cxx_only/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ if(NOT CxxQt_FOUND)
FetchContent_Declare(
CxxQt
GIT_REPOSITORY https://github.com/kdab/cxx-qt-cmake.git
GIT_TAG main
GIT_TAG wasm-set-cxxflags
# GIT_TAG main
)

FetchContent_MakeAvailable(CxxQt)
Expand Down
3 changes: 2 additions & 1 deletion tests/basic_cxx_qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ if(NOT CxxQt_FOUND)
FetchContent_Declare(
CxxQt
GIT_REPOSITORY https://github.com/kdab/cxx-qt-cmake.git
GIT_TAG main
GIT_TAG wasm-set-cxxflags
# GIT_TAG main
)

FetchContent_MakeAvailable(CxxQt)
Expand Down
3 changes: 2 additions & 1 deletion tests/qt_types_standalone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ if(NOT CxxQt_FOUND)
FetchContent_Declare(
CxxQt
GIT_REPOSITORY https://github.com/kdab/cxx-qt-cmake.git
GIT_TAG main
GIT_TAG wasm-set-cxxflags
# GIT_TAG main
)

FetchContent_MakeAvailable(CxxQt)
Expand Down

0 comments on commit 19bd854

Please sign in to comment.