mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
sdl2-sys: Skip defining _fltused (#1082)
Upstream SDL2 will include _fltused in the libary artifact as a __declspec(selectany) symbol. This seems to cause problems however with a definition already coming from the top-most rust link, as it already gets defined elsewhere when building statically. Rather than patching the upstream codebase with another patch, just specify this flag in all cases as we don't require it in any of our rust builds.
This commit is contained in:
@@ -305,6 +305,12 @@ fn patch_sdl2(sdl2_source_path: &Path) {
|
||||
fn compile_sdl2(sdl2_build_path: &Path, target_os: &str) -> PathBuf {
|
||||
let mut cfg = cmake::Config::new(sdl2_build_path);
|
||||
|
||||
// Override __FLTUSED__ to keep the _fltused symbol from getting defined in the static build.
|
||||
// This conflicts and fails to link properly when building statically on Windows, likely due to
|
||||
// COMDAT conflicts/breakage happening somewhere.
|
||||
#[cfg(feature = "static-link")]
|
||||
cfg.cflag("-D__FLTUSED__");
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
{
|
||||
use version_compare::Version;
|
||||
|
||||
Reference in New Issue
Block a user