diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..298c3dd Binary files /dev/null and b/.DS_Store differ diff --git a/SDL2_image.dll b/SDL2_image.dll deleted file mode 100644 index 277e981..0000000 Binary files a/SDL2_image.dll and /dev/null differ diff --git a/SDL2_ttf.dll b/SDL2_ttf.dll deleted file mode 100644 index 24253fa..0000000 Binary files a/SDL2_ttf.dll and /dev/null differ diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..8f0b8e5 --- /dev/null +++ b/build.rs @@ -0,0 +1,42 @@ +use std::env; +use std::path::PathBuf; + +fn main() { + let target = env::var("TARGET").unwrap(); + if target.contains("pc-windows") { + let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR").unwrap()); + let mut lib_dir = manifest_dir.clone(); + let mut dll_dir = manifest_dir.clone(); + if target.contains("msvc") { + lib_dir.push("msvc"); + dll_dir.push("msvc"); + } + else { + lib_dir.push("gnu-mingw"); + dll_dir.push("gnu-mingw"); + } + lib_dir.push("lib"); + dll_dir.push("dll"); + if target.contains("x86_64") { + lib_dir.push("64"); + dll_dir.push("64"); + } + else { + lib_dir.push("32"); + dll_dir.push("32"); + } + println!("cargo:rustc-link-search=all={}", lib_dir.display()); + for entry in std::fs::read_dir(dll_dir).expect("Can't read DLL dir") { + let entry_path = entry.expect("Invalid fs entry").path(); + let file_name_result = entry_path.file_name(); + let mut new_file_path = manifest_dir.clone(); + if let Some(file_name) = file_name_result { + let file_name = file_name.to_str().unwrap(); + if file_name.ends_with(".dll") { + new_file_path.push(file_name); + std::fs::copy(&entry_path, new_file_path.as_path()).expect("Can't copy from DLL dir"); + } + } + } + } +} diff --git a/gnu-mingw/.DS_Store b/gnu-mingw/.DS_Store new file mode 100644 index 0000000..af4c86b Binary files /dev/null and b/gnu-mingw/.DS_Store differ diff --git a/gnu-mingw/dll/.DS_Store b/gnu-mingw/dll/.DS_Store new file mode 100644 index 0000000..d736f71 Binary files /dev/null and b/gnu-mingw/dll/.DS_Store differ diff --git a/gnu-mingw/dll/32/SDL2.dll b/gnu-mingw/dll/32/SDL2.dll new file mode 100755 index 0000000..ffe1b39 Binary files /dev/null and b/gnu-mingw/dll/32/SDL2.dll differ diff --git a/gnu-mingw/dll/32/SDL2_image.dll b/gnu-mingw/dll/32/SDL2_image.dll new file mode 100755 index 0000000..896e077 Binary files /dev/null and b/gnu-mingw/dll/32/SDL2_image.dll differ diff --git a/gnu-mingw/dll/32/SDL2_ttf.dll b/gnu-mingw/dll/32/SDL2_ttf.dll new file mode 100755 index 0000000..ce7b323 Binary files /dev/null and b/gnu-mingw/dll/32/SDL2_ttf.dll differ diff --git a/SDL2.dll b/gnu-mingw/dll/64/SDL2.dll old mode 100644 new mode 100755 similarity index 100% rename from SDL2.dll rename to gnu-mingw/dll/64/SDL2.dll diff --git a/gnu-mingw/dll/64/SDL2_image.dll b/gnu-mingw/dll/64/SDL2_image.dll new file mode 100755 index 0000000..9856682 Binary files /dev/null and b/gnu-mingw/dll/64/SDL2_image.dll differ diff --git a/gnu-mingw/dll/64/SDL2_ttf.dll b/gnu-mingw/dll/64/SDL2_ttf.dll new file mode 100755 index 0000000..a1891a6 Binary files /dev/null and b/gnu-mingw/dll/64/SDL2_ttf.dll differ diff --git a/gnu-mingw/lib/.DS_Store b/gnu-mingw/lib/.DS_Store new file mode 100644 index 0000000..3752a9f Binary files /dev/null and b/gnu-mingw/lib/.DS_Store differ diff --git a/gnu-mingw/lib/32/libSDL2.a b/gnu-mingw/lib/32/libSDL2.a new file mode 100644 index 0000000..c65749e Binary files /dev/null and b/gnu-mingw/lib/32/libSDL2.a differ diff --git a/gnu-mingw/lib/32/libSDL2.dll.a b/gnu-mingw/lib/32/libSDL2.dll.a new file mode 100755 index 0000000..4277d1e Binary files /dev/null and b/gnu-mingw/lib/32/libSDL2.dll.a differ diff --git a/gnu-mingw/lib/32/libSDL2.la b/gnu-mingw/lib/32/libSDL2.la new file mode 100755 index 0000000..85e978d --- /dev/null +++ b/gnu-mingw/lib/32/libSDL2.la @@ -0,0 +1,41 @@ +# libSDL2.la - a libtool library file +# Generated by libtool (GNU libtool) 2.4.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='../bin/SDL2.dll' + +# Names of this library. +library_names='libSDL2.dll.a' + +# The name of the static archive. +old_library='libSDL2.a' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2. +current=2600 +age=2600 +revision=4 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL2/SDL2-2.26.4/i686-w64-mingw32/lib' diff --git a/gnu-mingw/lib/32/libSDL2_image.a b/gnu-mingw/lib/32/libSDL2_image.a new file mode 100644 index 0000000..40cd2b0 Binary files /dev/null and b/gnu-mingw/lib/32/libSDL2_image.a differ diff --git a/gnu-mingw/lib/32/libSDL2_image.dll.a b/gnu-mingw/lib/32/libSDL2_image.dll.a new file mode 100755 index 0000000..1ac9f09 Binary files /dev/null and b/gnu-mingw/lib/32/libSDL2_image.dll.a differ diff --git a/gnu-mingw/lib/32/libSDL2_image.la b/gnu-mingw/lib/32/libSDL2_image.la new file mode 100755 index 0000000..7e2930a --- /dev/null +++ b/gnu-mingw/lib/32/libSDL2_image.la @@ -0,0 +1,41 @@ +# libSDL2_image.la - a libtool library file +# Generated by ltmain.sh (GNU libtool) 2.2.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='../bin/SDL2_image.dll' + +# Names of this library. +library_names='libSDL2_image.dll.a' + +# The name of the static archive. +old_library='libSDL2_image.a' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs=' -L/usr/local/i686-w64-mingw32/lib -lmingw32 /usr/local/i686-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2_image. +current=600 +age=600 +revision=3 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL_image/SDL2_image-2.6.3/i686-w64-mingw32/lib' diff --git a/gnu-mingw/lib/32/libSDL2_test.a b/gnu-mingw/lib/32/libSDL2_test.a new file mode 100644 index 0000000..78593c6 Binary files /dev/null and b/gnu-mingw/lib/32/libSDL2_test.a differ diff --git a/gnu-mingw/lib/32/libSDL2_test.la b/gnu-mingw/lib/32/libSDL2_test.la new file mode 100755 index 0000000..08392e7 --- /dev/null +++ b/gnu-mingw/lib/32/libSDL2_test.la @@ -0,0 +1,41 @@ +# libSDL2_test.la - a libtool library file +# Generated by libtool (GNU libtool) 2.4.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libSDL2_test.a' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs='' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2_test. +current=0 +age=0 +revision=0 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL2/SDL2-2.26.4/i686-w64-mingw32/lib' diff --git a/gnu-mingw/lib/32/libSDL2_ttf.a b/gnu-mingw/lib/32/libSDL2_ttf.a new file mode 100644 index 0000000..9f4130d Binary files /dev/null and b/gnu-mingw/lib/32/libSDL2_ttf.a differ diff --git a/gnu-mingw/lib/32/libSDL2_ttf.dll.a b/gnu-mingw/lib/32/libSDL2_ttf.dll.a new file mode 100755 index 0000000..bae8040 Binary files /dev/null and b/gnu-mingw/lib/32/libSDL2_ttf.dll.a differ diff --git a/gnu-mingw/lib/32/libSDL2_ttf.la b/gnu-mingw/lib/32/libSDL2_ttf.la new file mode 100755 index 0000000..2d7dfb5 --- /dev/null +++ b/gnu-mingw/lib/32/libSDL2_ttf.la @@ -0,0 +1,41 @@ +# libSDL2_ttf.la - a libtool library file +# Generated by ltmain.sh (GNU libtool) 2.2.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='../bin/SDL2_ttf.dll' + +# Names of this library. +library_names='libSDL2_ttf.dll.a' + +# The name of the static archive. +old_library='libSDL2_ttf.a' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs=' -lusp10 -lrpcrt4 -L/usr/local/i686-w64-mingw32/lib /usr/local/i686-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lsetupapi -lversion -luuid /opt/homebrew/Cellar/mingw-w64/10.0.0_4/toolchain-i686/i686-w64-mingw32/lib/../lib/libstdc++.la' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2_ttf. +current=2000 +age=2000 +revision=2 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL_ttf/SDL2_ttf-2.20.2/i686-w64-mingw32/lib' diff --git a/gnu-mingw/lib/32/libSDL2main.a b/gnu-mingw/lib/32/libSDL2main.a new file mode 100644 index 0000000..bfcd9d6 Binary files /dev/null and b/gnu-mingw/lib/32/libSDL2main.a differ diff --git a/gnu-mingw/lib/32/libSDL2main.la b/gnu-mingw/lib/32/libSDL2main.la new file mode 100755 index 0000000..260751f --- /dev/null +++ b/gnu-mingw/lib/32/libSDL2main.la @@ -0,0 +1,41 @@ +# libSDL2main.la - a libtool library file +# Generated by libtool (GNU libtool) 2.4.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libSDL2main.a' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs='' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2main. +current=0 +age=0 +revision=0 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL2/SDL2-2.26.4/i686-w64-mingw32/lib' diff --git a/gnu-mingw/lib/64/libSDL2.a b/gnu-mingw/lib/64/libSDL2.a new file mode 100644 index 0000000..51b9e72 Binary files /dev/null and b/gnu-mingw/lib/64/libSDL2.a differ diff --git a/gnu-mingw/lib/64/libSDL2.dll.a b/gnu-mingw/lib/64/libSDL2.dll.a new file mode 100755 index 0000000..bc67c8e Binary files /dev/null and b/gnu-mingw/lib/64/libSDL2.dll.a differ diff --git a/gnu-mingw/lib/64/libSDL2.la b/gnu-mingw/lib/64/libSDL2.la new file mode 100755 index 0000000..644f6cb --- /dev/null +++ b/gnu-mingw/lib/64/libSDL2.la @@ -0,0 +1,41 @@ +# libSDL2.la - a libtool library file +# Generated by libtool (GNU libtool) 2.4.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='../bin/SDL2.dll' + +# Names of this library. +library_names='libSDL2.dll.a' + +# The name of the static archive. +old_library='libSDL2.a' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs=' -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2. +current=2600 +age=2600 +revision=4 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL2/SDL2-2.26.4/x86_64-w64-mingw32/lib' diff --git a/gnu-mingw/lib/64/libSDL2_image.a b/gnu-mingw/lib/64/libSDL2_image.a new file mode 100644 index 0000000..cb70378 Binary files /dev/null and b/gnu-mingw/lib/64/libSDL2_image.a differ diff --git a/gnu-mingw/lib/64/libSDL2_image.dll.a b/gnu-mingw/lib/64/libSDL2_image.dll.a new file mode 100755 index 0000000..457287c Binary files /dev/null and b/gnu-mingw/lib/64/libSDL2_image.dll.a differ diff --git a/gnu-mingw/lib/64/libSDL2_image.la b/gnu-mingw/lib/64/libSDL2_image.la new file mode 100755 index 0000000..e6e7747 --- /dev/null +++ b/gnu-mingw/lib/64/libSDL2_image.la @@ -0,0 +1,41 @@ +# libSDL2_image.la - a libtool library file +# Generated by ltmain.sh (GNU libtool) 2.2.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='../bin/SDL2_image.dll' + +# Names of this library. +library_names='libSDL2_image.dll.a' + +# The name of the static archive. +old_library='libSDL2_image.a' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs=' -L/usr/local/x86_64-w64-mingw32/lib -lmingw32 /usr/local/x86_64-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lsetupapi -lversion -luuid' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2_image. +current=600 +age=600 +revision=3 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL_image/SDL2_image-2.6.3/x86_64-w64-mingw32/lib' diff --git a/gnu-mingw/lib/64/libSDL2_test.a b/gnu-mingw/lib/64/libSDL2_test.a new file mode 100644 index 0000000..8b6be21 Binary files /dev/null and b/gnu-mingw/lib/64/libSDL2_test.a differ diff --git a/gnu-mingw/lib/64/libSDL2_test.la b/gnu-mingw/lib/64/libSDL2_test.la new file mode 100755 index 0000000..d5d99ec --- /dev/null +++ b/gnu-mingw/lib/64/libSDL2_test.la @@ -0,0 +1,41 @@ +# libSDL2_test.la - a libtool library file +# Generated by libtool (GNU libtool) 2.4.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libSDL2_test.a' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs='' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2_test. +current=0 +age=0 +revision=0 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL2/SDL2-2.26.4/x86_64-w64-mingw32/lib' diff --git a/gnu-mingw/lib/64/libSDL2_ttf.a b/gnu-mingw/lib/64/libSDL2_ttf.a new file mode 100644 index 0000000..5170b5b Binary files /dev/null and b/gnu-mingw/lib/64/libSDL2_ttf.a differ diff --git a/gnu-mingw/lib/64/libSDL2_ttf.dll.a b/gnu-mingw/lib/64/libSDL2_ttf.dll.a new file mode 100755 index 0000000..d83b3cc Binary files /dev/null and b/gnu-mingw/lib/64/libSDL2_ttf.dll.a differ diff --git a/gnu-mingw/lib/64/libSDL2_ttf.la b/gnu-mingw/lib/64/libSDL2_ttf.la new file mode 100755 index 0000000..3d0e66a --- /dev/null +++ b/gnu-mingw/lib/64/libSDL2_ttf.la @@ -0,0 +1,41 @@ +# libSDL2_ttf.la - a libtool library file +# Generated by ltmain.sh (GNU libtool) 2.2.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='../bin/SDL2_ttf.dll' + +# Names of this library. +library_names='libSDL2_ttf.dll.a' + +# The name of the static archive. +old_library='libSDL2_ttf.a' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs=' -lusp10 -lrpcrt4 -L/usr/local/x86_64-w64-mingw32/lib /usr/local/x86_64-w64-mingw32/lib/libSDL2.la -ldinput8 -ldxguid -ldxerr8 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lsetupapi -lversion -luuid /opt/homebrew/Cellar/mingw-w64/10.0.0_4/toolchain-x86_64/x86_64-w64-mingw32/lib/../lib/libstdc++.la' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2_ttf. +current=2000 +age=2000 +revision=2 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL_ttf/SDL2_ttf-2.20.2/x86_64-w64-mingw32/lib' diff --git a/gnu-mingw/lib/64/libSDL2main.a b/gnu-mingw/lib/64/libSDL2main.a new file mode 100644 index 0000000..df93788 Binary files /dev/null and b/gnu-mingw/lib/64/libSDL2main.a differ diff --git a/gnu-mingw/lib/64/libSDL2main.la b/gnu-mingw/lib/64/libSDL2main.la new file mode 100755 index 0000000..92d726b --- /dev/null +++ b/gnu-mingw/lib/64/libSDL2main.la @@ -0,0 +1,41 @@ +# libSDL2main.la - a libtool library file +# Generated by libtool (GNU libtool) 2.4.6 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='' + +# Names of this library. +library_names='' + +# The name of the static archive. +old_library='libSDL2main.a' + +# Linker flags that cannot go in dependency_libs. +inherited_linker_flags='' + +# Libraries that this one depends upon. +dependency_libs='' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libSDL2main. +current=0 +age=0 +revision=0 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/Users/valve/release/SDL2/SDL2-2.26.4/x86_64-w64-mingw32/lib'