Skip to content

Commit

Permalink
cmake: set RUST_CXX_NO_EXCEPTIONS when building for emscripten
Browse files Browse the repository at this point in the history
  • Loading branch information
ahayzen-kdab committed Nov 18, 2024
1 parent 13e62c7 commit df86515
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmake/CxxQt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ function(cxx_qt_import_crate)
"QMAKE=${IMPORT_CRATE_QMAKE}"
$<$<BOOL:${CMAKE_RUSTC_WRAPPER}>:RUSTC_WRAPPER=${CMAKE_RUSTC_WRAPPER}>)

# When using WASM ensure that we have RUST_CXX_NO_EXCEPTIONS set
if (${CMAKE_SYSTEM_NAME} MATCHES "Emscripten")
set(EMSCRIPTEN_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRUST_CXX_NO_EXCEPTIONS")
message(STATUS "CXX-Qt found emscripten setting CXXFLAGS=${EMPSCRIPTEN_CXX_FLAGS}")
corrosion_set_env_vars(${CRATE} "CXXFLAGS=${EMPSCRIPTEN_CXX_FLAGS}")
endif()

file(MAKE_DIRECTORY "${IMPORT_CRATE_CXX_QT_EXPORT_DIR}/crates/${CRATE}/include/")
target_include_directories(${CRATE} INTERFACE "${IMPORT_CRATE_CXX_QT_EXPORT_DIR}/crates/${CRATE}/include/")

Expand Down

0 comments on commit df86515

Please sign in to comment.