Skip to content

Fixing bundled and static-link for macOS #858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
seivan opened this issue Feb 27, 2019 · 0 comments
Open

Fixing bundled and static-link for macOS #858

seivan opened this issue Feb 27, 2019 · 0 comments
Labels
build-process Everything related to build.rs, or the build process in general

Comments

@seivan
Copy link
Contributor

seivan commented Feb 27, 2019

If we can sorta squeeze in

  if(SDL_VIDEO_RENDER_METAL)
    find_library(METAL Metal)
    list(APPEND EXTRA_LIBS ${METAL})
    file(GLOB RENDER_SOURCES ${SDL2_SOURCE_DIR}/src/render/metal/*.m)
    set(SOURCE_FILES ${SOURCE_FILES} ${RENDER_SOURCES})
  endif()

in SDL's CMakeLists.txt before running this and set SDL_VIDEO_RENDER_METAL=1 for target_os == "darwin" then we can get both of those feature flags to work.

Obviously this belongs in upstream, but the process of getting pull requests to SDL is a bit tricky, I am hoping we can fix it in the crate by just injecting it into the string right before:

1509 //{Inject here}
1510 # iOS hack needed - http://code.google.com/p/ios-cmake/ ?
1511  if(SDL_VIDEO)
1512    if (IOS)
@Cobrand Cobrand added the build-process Everything related to build.rs, or the build process in general label Mar 1, 2019
ebkalderon added a commit to ebkalderon/dss-coding-assignment that referenced this issue Jan 22, 2021
It turns out that the "static-link" feature flag for the `sdl2-sys`
crate doesn't link `SDL2_Image` nor `SDL2_TTF`) into it, and the
"bundled" feature flag only fetches the main `libsdl2` library at build
time and not `SDL2_Image`. Plus, it seems that "bundled" and
"static-link" are also broken in other ways, at the time of writing:

Rust-SDL2/rust-sdl2#778
Rust-SDL2/rust-sdl2#851
Rust-SDL2/rust-sdl2#858
Rust-SDL2/rust-sdl2#1017
Rust-SDL2/rust-sdl2#1029
Rust-SDL2/rust-sdl2#1034

For the sake of reliability, this commit disables both Cargo feature
flags described for the `sdl2` dependency (thereby requiring the user to
install external dependencies) and introduces a detailed setup guide in
the `README.md` for Windows, macOS, and Linux.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-process Everything related to build.rs, or the build process in general
Projects
None yet
Development

No branches or pull requests

2 participants