Skip to content

Commit

Permalink
Fix build of nativesdk-slint-cpp
Browse files Browse the repository at this point in the history
Corrosion decides that it's not a cross-build and thus doesn't forward
CMAKE_SYSROOT to the rust linker flags. Those are needed though, so pass
it via the compiler wrapper scripts.
  • Loading branch information
tronical committed Nov 25, 2024
1 parent a2d3234 commit 21acd61
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recipes-slint/slint/slint-cpp-v2.inc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ do_configure[network] = "1"
# For crate dependencies from crates.io
do_compile[network] = "1"

do_configure:prepend:class-nativesdk() {
# Since Corrosion decides that the native build is not a cross-build, it won't forward CMAKE_SYSROOT.
# The sysroot however is instrumental, so pass it along via the toolchain and the cargo compile wrappers.
echo "set(CMAKE_C_COMPILER \"${WRAPPER_DIR}/cc-wrapper.sh\")" >> ${WORKDIR}/toolchain.cmake
echo "set(CMAKE_CXX_COMPILER \"${WRAPPER_DIR}/cxx-wrapper.sh\")" >> ${WORKDIR}/toolchain.cmake
}

do_configure() {
echo "set(CMAKE_SYSROOT \"${RECIPE_SYSROOT}\")" >> ${WORKDIR}/toolchain.cmake
cargo_bin_do_configure
Expand Down

0 comments on commit 21acd61

Please sign in to comment.