-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 3.0.0 #26276
base: master
Are you sure you want to change the base?
sfml: add version 3.0.0 #26276
Conversation
changes: - cmake required version 3.1 -> 3.24 - added SFML 3.0.0 source zip + sha256 - updated test_package.cpp to work with both SFML 3.0.0 The cmake minimum version was changed to 3.24 because: - Linux SFML 3.0.0 requires 3.22 - Windows SFML 3.0.0 requires 3.24 It was deemed simpler to just have a single version required for the sake of the test package. More info: https://github.com/SFML/SFML/blob/7f1162dfea4969bc17417563ac55d93b72e84c1e/CMakeLists.txt#L1-L9
4598181
to
8fc6848
Compare
Relevant folks I think would be interested / have useful things to say:
[Hope that's not too spammy / OK] |
RE multiple being developed at the same time (see #26266) - happy to discuss the merits of each / take the judgement of maintainers or whatever. They each appear to have their own merits. Perhaps they could be combined? Pros of this one:
Pros of alternative:
[ feel free to add anything I missed here - I am almost certainly bias as author ] |
The sole reason mine exists was that I require SFML 3 for a project and it wasn't available on conan, nor did I see a PR for it. So I adjusted and added SFML 3 and figured I might as well upstream it for the benefits of others after some preliminary testing. I didn't knowingly remove anything that didn't produce errors for me (or later anything that created linter warnings in CCI). So if I removed sfml-main then it caused errors and didn't appear to be required. |
@@ -51,6 +52,10 @@ def configure(self): | |||
def layout(self): | |||
cmake_layout(self, src_folder="src") | |||
|
|||
def build_requirements(self): | |||
if Version(self.version) >= "3.0.0": | |||
self.tool_requires("cmake/[>=3.24]") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3.24 is only required on Windows. All other OSes only require 3.22.
if Version(self.version) >= "3.0.0": | ||
return 17 | ||
elif Version(self.version) >= "2.6.0": | ||
return 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version 2.6 and prior requires C++03, not C++11.
@@ -91,10 +107,12 @@ def generate(self): | |||
tc.variables["SFML_BUILD_AUDIO"] = self.options.audio | |||
tc.variables["SFML_INSTALL_PKGCONFIG_FILES"] = False | |||
tc.variables["SFML_GENERATE_PDB"] = False | |||
tc.variables["SFML_USE_SYSTEM_DEPS"] = True | |||
tc.variables["SFML_USE_SYSTEM_DEPS"] = Version(self.version) < "3.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why change this? A package manager probably wants to use its own dependencies instead of the dependencies bundled with the library.
tc.variables["CMAKE_CXX_STANDARD"] = 11 | ||
|
||
if self.settings.compiler.cppstd is not None: | ||
tc.cache_variables["CMAKE_CXX_STANDARD"] = self._min_cppstd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to set this. The CMake script already uses target_compile_features
to set the proper C++ standard version.
@@ -1,4 +1,4 @@ | |||
cmake_minimum_required(VERSION 3.1) | |||
cmake_minimum_required(VERSION 3.24) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Building SFML requires 3.22 (or 3.24 on Windows as mentioned above). Using SFML doesn't require anything particularly new. 3.1 is probably too old but something like 3.10 or 3.16 is probably sufficient. 3.16 or 3.22 are reasonable choices since it's rare you find an OS still in use today that ships with anything older than that.
Summary
Added recipe: sfml/3.0.0
Motivation
SFML 3.0 was released.
Details
Notable changes:
The cmake minimum version was changed to 3.24 because:
It was deemed simpler to just have a single version required for the sake of the test package.
More info: https://github.com/SFML/SFML/blob/7f1162dfea4969bc17417563ac55d93b72e84c1e/CMakeLists.txt#L1-L9
Linux 6.11.11-1-MANJARO SMP PREEMPT_DYNAMIC
conan create all/conanfile.py --version 3.0.0 --build=missing
conan create all/conanfile.py --version 2.6.1 --build=missing