-
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
raylib: add some common build settings to options #24585
Conversation
This comment has been minimized.
This comment has been minimized.
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.
Thanks @Julianiolo for taking the time to add the options :)
Co-authored-by: Abril Rincón Blanco <[email protected]>
This comment has been minimized.
This comment has been minimized.
As this configuration is not exposed as project option, I would suggest using Conan configuration to pass any custom definition to the compiler instead: https://docs.conan.io/2/reference/config_files/global_conf.html You can add it to your profile, or use via command line directly:
This configuration will pass As it may affect the package ID, in case changing the result of the library behavior, you still can inject that configuration as part of the package ID as well:
So, in summary |
@uilianries I think they are intended as project options, raylib just manages them via this config.h file, not via some build script. (as It also has build scripts for like 5+ different build systems) The intention is to be able to set these options from a consuming recipe, would that even be possible with the configuration? |
@Julianiolo I'm reading raylib cmake files and indeed those options are exposed: https://github.com/raysan5/raylib/blob/5.0/CMakeOptions.txt#L31. Why passing via
Configurations work for both cases, building and consuming. |
Oh WOW, how did I not see that lol, I was looking at the wrong CMakeLists.txt.... |
This comment has been minimized.
This comment has been minimized.
@Julianiolo That could work, but need to test first. Thank for spotting it. |
recipes/raylib/all/conanfile.py
Outdated
true_false = lambda x: True if x else False | ||
tc.variables["SUPPORT_MODULE_RSHAPES"] = true_false(self.options.module_rshapes) |
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.
true_false = lambda x: True if x else False | |
tc.variables["SUPPORT_MODULE_RSHAPES"] = true_false(self.options.module_rshapes) | |
tc.variables["SUPPORT_MODULE_RSHAPES"] = self.options.module_rshapes |
The OptionValue is converted to boolean already, you should not need another helper function.
recipes/raylib/all/conanfile.py
Outdated
} | ||
default_options = { | ||
"shared": False, | ||
"fPIC": True, | ||
"opengl_version": None, | ||
|
||
"module_rshapes": True, |
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.
I would suggest adding only option that you really need for now, otherwise, it will increase the recipe maintenance. We can not validate each combination, which means there is a risk breaking things depending the combination.
I also would request a build log, if possible, using the options that you are adding, I mean, using the non-default option value, to make sure it's not broken. I asking it because we found recipes with custom options that are not working and the CI really does not check it (only shared, fPIC and header_only are checked), so any user opens an issue months later reporting about that option is broken and recipe/upstream is bugged.
Co-authored-by: Uilian Ries <[email protected]>
@uilianries I just saw this: raysan5/raylib@307c998 So I guess maybe the patching approach is actually more future safe? On second thought, why does it parse the config.h to then produce cmake options, when it could just include the config.h in the code?? |
This comment has been minimized.
This comment has been minimized.
@Julianiolo because we avoid patching anything as we will become the maintainers of that patch. The project offers transparent options via CMake, and it reflects to the Conan generator CMaketoolchain, that's is well prepared and integrated to work with the project, and we have been using it for any other project. So, using CMake will consume less maintenance from our side. |
@uilianries No, with that commit, it does not support options via cmake anymore (or am I reading this wrong?) I'm going to investigate this... |
Ok, turns out I was reading that completely wrong, lol |
This comment has been minimized.
This comment has been minimized.
So now I removed some options, and added a @uilianries Do you mean by build logs just the output from |
@Julianiolo What do you mean exactly? The test package should receive the include dirs from Conan generators, like CMakeDeps. In the test pacakge, you should not need to configure dependencies include dirs, only consume them. |
@uilianries well we copy the headers in the test package ( the |
@uilianries any idea on this? |
Hello @Julianiolo ! I'm on vacation 🌴, please, ping |
@uilianries ah sorry then, have a nice vacation :) |
Signed-off-by: Uilian Ries <[email protected]>
Signed-off-by: Uilian Ries <[email protected]>
@Julianiolo Hello again! I reviewed this PR again and tested locally. Please, consider the PR Julianiolo#1 as my review/fixing. |
[raylib] Simplify custom modules options
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Uilian Ries <[email protected]>
This comment has been minimized.
This comment has been minimized.
@uilianries how did this fail again? Also, why does it even suddenly need that policy? Also also, how does Conan 1 fail with a compile error? (This is the problem that raylib defines functions with the same name as |
@Julianiolo You have to revert the commit 08dc263 This recipe has patches and they are needed! https://github.com/conan-io/conan-center-index/tree/master/recipes/raylib/all/patches |
@uilianries OH, you are right... The Recipe linter gave me an error about them being unused (see), I guess that is a bug... |
@Julianiolo You are right, it's a bug! Good catch. It's because the version 5.0 does not have any patch. Will open an issue reporting the case, thank you! |
Conan v1 pipeline ✔️Warning Conan Center will stop receiving updates for Conan 1.x packages soon - please see announcement. All green in build 16 (
Conan v2 pipeline ✔️
All green in build 16 ( |
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.
LGTM
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.
Thanks!
* support custom frame control * add some more common settings * Update recipes/raylib/all/conanfile.py Co-authored-by: Abril Rincón Blanco <[email protected]> * moved from patching defines to cmake options * Update recipes/raylib/all/conanfile.py Co-authored-by: Uilian Ries <[email protected]> * reduce number of options * reduced number of options, added on_off converter * removed some options * incorporated review * add camera, gestures and rprand support * added resdirs * Simplify custom modules headers Signed-off-by: Uilian Ries <[email protected]> * Include headers from version 3.5.0 Signed-off-by: Uilian Ries <[email protected]> * fix rprand typo * fix linter warnings * Update recipes/raylib/all/conanfile.py Co-authored-by: Uilian Ries <[email protected]> * readd patches --------- Signed-off-by: Uilian Ries <[email protected]> Co-authored-by: Abril Rincón Blanco <[email protected]> Co-authored-by: Uilian Ries <[email protected]>
Summary
Changes to recipe: raylib/*
Motivation
raylib defines a lot of build settings in
config.h
. I added some of the most common/important ones to the recipe optionsDetails
We just patch the
config.h
file to match the options. This seems to be the easiest way to do this, and it makes theconfig.h
file mirror the current configuration (although that file is currently not exported; I guess this is relevant to that: #24472).