Skip to content
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

sdl2 version 2.24.0 #12186

Merged
merged 33 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
795c946
sdl2 version 2.0.22
paulocoutinhox Aug 12, 2022
70e159c
sdl2 version 2.0.22
paulocoutinhox Aug 12, 2022
e91632a
sdl2 version 2.0.22
paulocoutinhox Aug 12, 2022
6b523e0
sdl2 version 2.0.22
paulocoutinhox Aug 14, 2022
1cdc11b
sdl2 version 2.0.22
paulocoutinhox Aug 14, 2022
26b47db
sdl2 version 2.0.22
paulocoutinhox Aug 15, 2022
6db13a5
sdl2 version 2.0.22
paulocoutinhox Aug 15, 2022
657ff38
sdl2 version 2.0.22
paulocoutinhox Aug 15, 2022
86591e9
Update recipes/sdl/all/CMakeLists.txt
paulocoutinhox Aug 15, 2022
a5c360d
Update recipes/sdl/all/CMakeLists.txt
paulocoutinhox Aug 16, 2022
48cec59
Update recipes/sdl/all/conanfile.py
paulocoutinhox Aug 16, 2022
883b291
Update recipes/sdl/all/conanfile.py
paulocoutinhox Aug 16, 2022
056036e
Update recipes/sdl/all/conandata.yml
paulocoutinhox Aug 16, 2022
0a16846
sdl2 version 2.0.22
paulocoutinhox Aug 16, 2022
1f9dff8
sdl2 version 2.0.22
paulocoutinhox Aug 16, 2022
982de81
sdl2 version 2.0.22
paulocoutinhox Aug 16, 2022
545498f
sdl2 version 2.0.22
paulocoutinhox Aug 16, 2022
41a4e7c
sdl2 version 2.0.22
paulocoutinhox Aug 17, 2022
b370da5
update sdl to 2.24.0
paulocoutinhox Aug 21, 2022
ad2841c
Merge branch 'master' of github.com:paulocoutinhox/conan-center-index…
paulocoutinhox Aug 30, 2022
7a063e2
sdl2 version 2.24.0
paulocoutinhox Aug 30, 2022
982f6d9
Update recipes/sdl/all/conanfile.py
paulocoutinhox Aug 30, 2022
75ae864
Update recipes/sdl/all/conanfile.py
paulocoutinhox Aug 30, 2022
6215132
update recipes/sdl/all/conanfile.py
paulocoutinhox Aug 30, 2022
564bae5
sdl2 version 2.24.0
paulocoutinhox Aug 31, 2022
5d64899
Merge branch 'sdl2-2-0-22' of github.com:paulocoutinhox/conan-center-…
paulocoutinhox Aug 31, 2022
7af5c28
sdl2 version 2.24.0
paulocoutinhox Aug 31, 2022
b3b7a4f
sdl2 version 2.24.0
paulocoutinhox Sep 1, 2022
ac6cc65
sdl2 version 2.24.0
paulocoutinhox Sep 1, 2022
d2be641
sdl2 version 2.24.0
paulocoutinhox Sep 1, 2022
417f598
sdl2 version 2.24.0
paulocoutinhox Sep 1, 2022
b2902fd
Update conan tools imports
uilianries Sep 2, 2022
7f94fe2
Merge pull request #5 from uilianries/sdl2-2-0-22
paulocoutinhox Sep 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions recipes/sdl/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.24.0":
url: "https://www.libsdl.org/release/SDL2-2.24.0.tar.gz"
sha256: 91e4c34b1768f92d399b078e171448c6af18cafda743987ed2064a28954d6d97
"2.0.20":
url: "https://www.libsdl.org/release/SDL2-2.0.20.tar.gz"
sha256: c56aba1d7b5b0e7e999e4a7698c70b63a3394ff9704b5f6e1c57e0c16f04dd06
Expand All @@ -12,6 +15,9 @@ sources:
url: "https://www.libsdl.org/release/SDL2-2.0.14.tar.gz"
sha256: d8215b571a581be1332d2106f8036fcb03d12a70bae01e20f424976d275432bc
patches:
"2.0.20":
- patch_file: "patches/0004-2.0.20-ndk.patch"
base_path: "source_subfolder"
"2.0.16":
- patch_file: "patches/0003-2.0.16-wayland-scanner-buildrequires.patch"
base_path: "source_subfolder"
Expand Down
19 changes: 18 additions & 1 deletion recipes/sdl/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from conan.tools.apple import is_apple_os
from conan.tools.files import apply_conandata_patches, get, replace_in_file, rm, rmdir
from conan.tools.microsoft import is_msvc
from conan.tools.build import cross_building
from conan.tools.scm import Version
from conans import CMake, tools
import functools
Expand Down Expand Up @@ -170,6 +171,13 @@ def package_id(self):
del self.info.options.sdl2main

def build_requirements(self):
if self.settings.os == "Macos" and cross_building(self):
# Workaround for CMake bug with error message:
# Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being
# set. This could be because you are using a Mac OS X version less than 10.5
# or because CMake's platform configuration is corrupt.
# FIXME: Remove once CMake on macOS/M1 CI runners is upgraded.
self.build_requires("cmake/3.22.0")
if self.settings.os == "Linux":
self.build_requires("pkgconf/1.7.4")
if hasattr(self, "settings_build") and self.options.get_safe("wayland"):
Expand Down Expand Up @@ -198,6 +206,11 @@ def _patch_sources(self):
@functools.lru_cache(1)
def _configure_cmake(self):
cmake = CMake(self)
paulocoutinhox marked this conversation as resolved.
Show resolved Hide resolved
cmake.definitions["SDL2_DISABLE_INSTALL"] = False # SDL2_* options will get renamed to SDL_ options in the next SDL release
if is_apple_os(self):
cmake.definitions["CMAKE_OSX_ARCHITECTURES"] = {
"armv8": "arm64",
}.get(str(self.settings.arch), str(self.settings.arch))
cmake_required_includes = [] # List of directories used by CheckIncludeFile (https://cmake.org/cmake/help/latest/module/CheckIncludeFile.html)
cmake_extra_ldflags = []
# FIXME: self.install_folder not defined? Neccessary?
Expand Down Expand Up @@ -380,6 +393,10 @@ def package_info(self):
postfix = "d" if self.settings.os != "Android" and self.settings.build_type == "Debug" else ""

# SDL2
lib_postfix = postfix
if self.version >= "2.0.24" and is_msvc(self) and not self.options.shared:
lib_postfix = "-static" + postfix

self.cpp_info.components["libsdl2"].set_property("cmake_target_name", "SDL2::SDL2")
if not self.options.shared:
self.cpp_info.components["libsdl2"].set_property("cmake_target_aliases", ["SDL2::SDL2-static"])
Expand All @@ -390,7 +407,7 @@ def package_info(self):
self.cpp_info.components["libsdl2"].names["cmake_find_package_multi"] = sdl2_cmake_target

self.cpp_info.components["libsdl2"].includedirs.append(os.path.join("include", "SDL2"))
self.cpp_info.components["libsdl2"].libs = ["SDL2" + postfix]
self.cpp_info.components["libsdl2"].libs = ["SDL2" + lib_postfix]
if self.options.get_safe("iconv", False):
self.cpp_info.components["libsdl2"].requires.append("libiconv::libiconv")
if self.settings.os == "Linux":
Expand Down
26 changes: 26 additions & 0 deletions recipes/sdl/all/patches/0004-2.0.20-ndk.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -526,13 +526,17 @@ if(USE_GCC OR USE_CLANG)
list(APPEND EXTRA_CFLAGS "-fno-strict-aliasing")
endif()

- check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
- if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
- check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
- if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
- list(APPEND EXTRA_CFLAGS "-Werror=declaration-after-statement")
+ # Android needs to bring in external files that don't adhere to the declaration-after-statement
+ # warning, so skip this warning on Android.
+ if(NOT ANDROID)
+ check_c_compiler_flag(-Wdeclaration-after-statement HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
+ if(HAVE_GCC_WDECLARATION_AFTER_STATEMENT)
+ check_c_compiler_flag(-Werror=declaration-after-statement HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
+ if(HAVE_GCC_WERROR_DECLARATION_AFTER_STATEMENT)
+ list(APPEND EXTRA_CFLAGS "-Werror=declaration-after-statement")
+ endif()
+ list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement")
endif()
- list(APPEND EXTRA_CFLAGS "-Wdeclaration-after-statement")
endif()

if(DEPENDENCY_TRACKING)
5 changes: 3 additions & 2 deletions recipes/sdl/all/test_package/conanfile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from conans import ConanFile, CMake, tools
from conans import ConanFile, CMake
from conan.tools.build import cross_building
import os


Expand All @@ -21,6 +22,6 @@ def build(self):
cmake.build()

def test(self):
if not tools.cross_building(self):
if not cross_building(self):
bin_path = os.path.join("bin", "test_package")
self.run(bin_path, run_environment=True)
2 changes: 2 additions & 0 deletions recipes/sdl/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"2.24.0":
folder: all
"2.0.20":
folder: all
"2.0.18":
Expand Down