Skip to content

Odd issue with include paths and wasm32-wasi target because .h file gets detected as C rather than C++ #1908

Open
@devsnek

Description

@devsnek

I apologize for not having a minimal reproduction but I honestly have no idea what is going on here. I am having to add these lines to my build script to make it work:

https://github.com/devsnek/airbus-fbw-rs/blob/8866d48b156b8d58930332b2824a280f4bcfee9b/build.rs#L47-L50

Without those lines, I see the following output:

  --- stderr
  clang version 11.0.0
  Target: wasm32-unknown-wasi
  Thread model: posix
  InstalledDir:
  ignoring nonexistent directory "C:\MSFS SDK\/WASM/wasi-sysroot/include/wasm32-wasi/c++/v1"
  ignoring nonexistent directory "lib\clang\11.0.0\include"
  ignoring nonexistent directory "C:\MSFS SDK\/WASM/wasi-sysroot/include/wasm32-wasi"
  ignoring duplicate directory "C:\MSFS SDK\/WASM/wasi-sysroot/include"
  #include "..." search starts here:
  #include <...> search starts here:
   ./airbus-fbw-bench/src-model/src
   C:\Program Files\LLVM\lib\clang\11.0.0\include
   C:\MSFS SDK\/WASM/wasi-sysroot/include
   C:\MSFS SDK\/WASM/wasi-sysroot/include/c++/v1
  End of search list.
  C:\MSFS SDK\/WASM/wasi-sysroot/include/c++/v1\cstddef:44:15: fatal error: 'stddef.h' file not found
  C:\MSFS SDK\/WASM/wasi-sysroot/include/c++/v1\cstddef:44:15: fatal error: 'stddef.h' file not found, err: true
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ()', build.rs:58:14
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions