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

sfml: add version 2.6.2 #25936

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions recipes/sfml/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"2.6.2":
url: "https://www.sfml-dev.org/files/SFML-2.6.2-sources.zip"
sha256: "19d6dbd9c901c74441d9888c13cb1399f614fe8993d59062a72cfbceb00fed04"
"2.6.1":
url: "https://www.sfml-dev.org/files/SFML-2.6.1-sources.zip"
sha256: "5bf19e5c303516987f7f54d4ff1b208a0f9352ffa1cd55f992527016de0e8cb7"
Expand All @@ -9,6 +12,16 @@ sources:
url: "https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip"
sha256: "bf1e0643acb92369b24572b703473af60bac82caf5af61e77c063b779471bb7f"
patches:
"2.6.2":
- patch_file: "patches/2.6.2-0001-cmake-robust-find-deps.patch"
patch_description: "Robust discovery of dependencies"
patch_type: "conan"
- patch_file: "patches/2.6.2-0003-allow-shared-MT.patch"
patch_description: "Allow to build shared SFML with MT runtime"
patch_type: "portability"
- patch_file: "patches/2.6.1-0006-disable-warning-flags.patch"
patch_description: "Disable warning flags which may cause compilation errors"
patch_type: "portability"
"2.6.1":
- patch_file: "patches/2.6.0-0001-cmake-robust-find-deps.patch"
patch_description: "Robust discovery of dependencies"
Expand Down
61 changes: 61 additions & 0 deletions recipes/sfml/all/patches/2.6.2-0001-cmake-robust-find-deps.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
diff --git a/src/SFML/Audio/CMakeLists.txt b/src/SFML/Audio/CMakeLists.txt
index 8158365..0159be1 100644
--- a/src/SFML/Audio/CMakeLists.txt
+++ b/src/SFML/Audio/CMakeLists.txt
@@ -69,12 +69,12 @@ endif()

# find external libraries
find_package(OpenAL REQUIRED)
-sfml_find_package(VORBIS INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES")
+sfml_find_package(Vorbis INCLUDE "VORBIS_INCLUDE_DIRS" LINK "VORBIS_LIBRARIES")
sfml_find_package(FLAC INCLUDE "FLAC_INCLUDE_DIR" LINK "FLAC_LIBRARY")

# avoids warnings in vorbisfile.h
-target_compile_definitions(VORBIS INTERFACE "OV_EXCLUDE_STATIC_CALLBACKS")
-target_compile_definitions(FLAC INTERFACE "FLAC__NO_DLL")
+# target_compile_definitions(VORBIS INTERFACE "OV_EXCLUDE_STATIC_CALLBACKS")
+# target_compile_definitions(FLAC INTERFACE "FLAC__NO_DLL")

# define the sfml-audio target
sfml_add_library(sfml-audio
@@ -84,7 +84,8 @@ sfml_add_library(sfml-audio
target_link_libraries(sfml-audio PRIVATE OpenAL::OpenAL)

# minimp3 sources
-target_include_directories(sfml-audio SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/minimp3")
+find_package(minimp3 REQUIRED CONFIG)
+target_include_directories(sfml-audio SYSTEM PRIVATE ${minimp3_INCLUDE_DIRS})

if(SFML_OS_ANDROID)
target_link_libraries(sfml-audio PRIVATE android OpenSLES)
@@ -92,4 +93,4 @@ endif()

target_link_libraries(sfml-audio
PUBLIC sfml-system
- PRIVATE VORBIS FLAC)
+ PRIVATE Vorbis::vorbisenc Vorbis::vorbisfile FLAC::FLAC minimp3::minimp3)
diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt
index a939a98..bd6a89b 100644
--- a/src/SFML/Graphics/CMakeLists.txt
+++ b/src/SFML/Graphics/CMakeLists.txt
@@ -93,7 +93,8 @@ sfml_add_library(sfml-graphics
target_link_libraries(sfml-graphics PUBLIC sfml-window)

# stb_image sources
-target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/stb_image")
+find_package(stb REQUIRED CONFIG)
+target_link_libraries(sfml-graphics PRIVATE stb::stb)

# glad sources
target_include_directories(sfml-graphics SYSTEM PRIVATE "${PROJECT_SOURCE_DIR}/extlibs/headers/glad/include")
@@ -123,8 +124,8 @@ if((SFML_COMPILER_MSVC AND SFML_MSVC_VERSION GREATER_EQUAL 14) OR (SFML_COMPILER
target_link_libraries(sfml-graphics PRIVATE legacy_stdio_definitions.lib)
endif()

-sfml_find_package(Freetype INCLUDE "FREETYPE_INCLUDE_DIRS" LINK "FREETYPE_LIBRARY")
-target_link_libraries(sfml-graphics PRIVATE Freetype)
+find_package(freetype REQUIRED)
+target_link_libraries(sfml-graphics PRIVATE freetype)

# add preprocessor symbols
target_compile_definitions(sfml-graphics PRIVATE "STBI_FAILURE_USERMSG")
13 changes: 13 additions & 0 deletions recipes/sfml/all/patches/2.6.2-0003-allow-shared-MT.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a302f23..afe1830 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -208,7 +208,7 @@ if(SFML_OS_WINDOWS)
sfml_set_option(SFML_USE_STATIC_STD_LIBS FALSE BOOL "TRUE to statically link to the standard libraries, FALSE to use them as DLLs")

# the following combination of flags is not valid
- if(BUILD_SHARED_LIBS AND SFML_USE_STATIC_STD_LIBS)
+ if(0)
message(FATAL_ERROR "BUILD_SHARED_LIBS and SFML_USE_STATIC_STD_LIBS cannot be used together")
endif()

2 changes: 2 additions & 0 deletions recipes/sfml/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"2.6.2":
folder: all
"2.6.1":
folder: all
"2.6.0":
Expand Down