Skip to content

Commit

Permalink
Fix additional emscripten sysroot paths
Browse files Browse the repository at this point in the history
  • Loading branch information
guusw committed Jan 31, 2025
1 parent bcef0ca commit 5023e95
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmake/Rust.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ function(add_rust_library)
if(EMSCRIPTEN_SYSROOT)
file(TO_CMAKE_PATH "${EMSCRIPTEN_SYSROOT}" TMP_SYSROOT)
list(APPEND EXTRA_CLANG_ARGS "--sysroot=${TMP_SYSROOT}")
list(APPEND EXTRA_CLANG_ARGS "-iwithsysroot${TMP_SYSROOT}/include/compat")
elseif(CMAKE_SYSROOT)
file(TO_CMAKE_PATH "${CMAKE_SYSROOT}" TMP_SYSROOT)
list(APPEND EXTRA_CLANG_ARGS "--sysroot=${CMAKE_SYSROOT}")
Expand All @@ -278,6 +279,8 @@ function(add_rust_library)

if(EXTRA_CLANG_ARGS)
set(BINDGEN_EXTRA_CLANG_ARGS BINDGEN_EXTRA_CLANG_ARGS="${EXTRA_CLANG_ARGS}")
else()
set(BINDGEN_EXTRA_CLANG_ARGS)
endif()

set(_RUST_ENVIRONMENT ${RUST_ENVIRONMENT})
Expand Down

0 comments on commit 5023e95

Please sign in to comment.