emscripten-core / emsdk

Emscripten SDK
http://emscripten.org
Other
2.96k stars 676 forks source link

[Regression] new versions do not include SDL2 #1301

Closed skhaz closed 9 months ago

skhaz commented 9 months ago

I reported this issue in the Conan repository, thinking it was some release that broke. I tried downgrading Conan and the SDL library and encountered the same error listed below, so I decided to downgrade the emsdk to version 3.1.44 and was able to confirm that the new versions of emsdk have some kind of regression that does not include SDL2.

CMake Error in CMakeLists.txt:
  Imported target "SDL2::SDL2-static" includes non-existent path

    "/home/runner/.conan2/p/emsdke60e2b9a46b66/p/bin/upstream/emscripten/cache/sysroot/include/SDL2"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:

  * The path was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and references files it does not
  provide.

emsdk working version with Conan: 3.1.44

cat > ~/.conan2/profiles/webassembly <<EOF
include(default)

[settings]
arch=wasm
os=Emscripten

[tool_requires]
*: emsdk/3.1.44
EOF

emdk version not working: 3.1.48

sbc100 commented 9 months ago

emsdk doesn't include prebuilt versions of SDL2. As far as I know it never has.

The SDL2 library will be built and installed the first time you run emcc with -sUSE_SDL=2. Alternatively you can build it explictly using embuilder build sdl2.

In other words, when you fist install emsdk (either 3.1.44 or 3.1.48) the upstream/emscripten/cache/sysroot/include/SDL2 is not expected to exist.