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

raylib: add some common build settings to options #24585

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Julianiolo
Copy link
Contributor

@Julianiolo Julianiolo commented Jul 11, 2024

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 options

Details

We just patch the config.h file to match the options. This seems to be the easiest way to do this, and it makes the config.h file mirror the current configuration (although that file is currently not exported; I guess this is relevant to that: #24472).


@conan-center-bot

This comment has been minimized.

@AbrilRBS AbrilRBS self-assigned this Jul 11, 2024
AbrilRBS
AbrilRBS previously approved these changes Jul 15, 2024
Copy link
Member

@AbrilRBS AbrilRBS left a 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 :)

recipes/raylib/all/conanfile.py Outdated Show resolved Hide resolved
Co-authored-by: Abril Rincón Blanco <[email protected]>
@conan-center-bot

This comment has been minimized.

@uilianries
Copy link
Member

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:

conan create all --version=5.0 -c 'tools.build:defines=["SUPPORT_MODULE_RTEXTURES", "SUPPORT_MODULE_RAUDIO"]'

This configuration will pass -DSUPPORT_MODULE_RTEXTURES -DSUPPORT_MODULE_RAUDIO directly to the compiler. The -D is automatically added by CMake, Conan passes those definition to the build tool actually.

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:

conan create all --version=5.0 -c 'tools.build:defines=["SUPPORT_MODULE_RTEXTURES", "SUPPORT_MODULE_RAUDIO"]' -c 'tools.info.package_id:confs=["tools.build:defines"]'

So, in summary tools.info.package_id:confs will change the package ID according to defines listed in the tools.build:defines, in case you change that values, it will result in a different package ID as well.

@Julianiolo
Copy link
Contributor Author

Julianiolo commented Jul 15, 2024

@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?

@uilianries
Copy link
Member

@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 CMakeToolchain.variables does not work?

The intention is to be able to set these options from a consuming recipe, would that even be possible with the configuration?

Configurations work for both cases, building and consuming.

@Julianiolo
Copy link
Contributor Author

Oh WOW, how did I not see that lol, I was looking at the wrong CMakeLists.txt....

@Julianiolo
Copy link
Contributor Author

I just saw this, I guess this might just be the solution to #24472? Unless there are more relevant files.

@conan-center-bot

This comment has been minimized.

@uilianries
Copy link
Member

@Julianiolo That could work, but need to test first. Thank for spotting it.

recipes/raylib/all/conanfile.py Outdated Show resolved Hide resolved
Comment on lines 114 to 115
true_false = lambda x: True if x else False
tc.variables["SUPPORT_MODULE_RSHAPES"] = true_false(self.options.module_rshapes)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

}
default_options = {
"shared": False,
"fPIC": True,
"opengl_version": None,

"module_rshapes": True,
Copy link
Member

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.

@Julianiolo
Copy link
Contributor Author

Julianiolo commented Jul 16, 2024

@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??

@conan-center-bot

This comment has been minimized.

@uilianries
Copy link
Member

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??

@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.

@Julianiolo
Copy link
Contributor Author

Julianiolo commented Jul 16, 2024

@uilianries No, with that commit, it does not support options via cmake anymore (or am I reading this wrong?)
The commit is newer than 5.0

I'm going to investigate this...

@Julianiolo
Copy link
Contributor Author

Ok, turns out I was reading that completely wrong, lol
It generates the cmake options from config.h, everything should work as before

@conan-center-bot

This comment has been minimized.

@Julianiolo
Copy link
Contributor Author

So now I removed some options, and added a on_off converter, as I had some problems just passing the booleans to cmake.

@uilianries Do you mean by build logs just the output from conan create all/conanfile.py .... ? I can certainly do that :)

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@Julianiolo
Copy link
Contributor Author

@uilianries so what is the status?

@uilianries
Copy link
Member

@Julianiolo like I commented before (#24585 (comment)) I would recommend only adding those options that you really need.

Plus, add a full build log with those options values (e.g module_rshapes is True, then we need a build with False). As you can see, as more option, worst is tracking and maintaining. Regards.

@Julianiolo
Copy link
Contributor Author

Julianiolo commented Sep 18, 2024

@uilianries

Build log

conan create all\conanfile.py --version=5.0 -o raylib/*:events_waiting=True -o raylib/*:custom_frame_control=True > build.txt 2>&1


======== Exporting recipe to the cache ========
raylib/5.0: Exporting package recipe: C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\conanfile.py
raylib/5.0: exports: File 'conandata.yml' found. Exporting it...
raylib/5.0: Calling export_sources()
raylib/5.0: Copied 1 '.yml' file: conandata.yml
raylib/5.0: Copied 1 '.py' file: conanfile.py
raylib/5.0: Exported to cache folder: C:\Users\-\.conan2\p\raylif4aa8d3974579\e
raylib/5.0: Exported: raylib/5.0#deff1cef784b3804aba650d395ca9461 (2024-09-18 11:49:12 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[options]
raylib/*:custom_frame_control=True
raylib/*:events_waiting=True

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows


======== Computing dependency graph ========
Graph root
    cli
Requirements
    glfw/3.4#556ce0bc9e0abc75fe4378b86e566fc4 - Cache
    opengl/system#4df6fecde4084386beded3ed0e56e4ea - Cache
    raylib/5.0#deff1cef784b3804aba650d395ca9461 - Cache

======== Computing necessary packages ========
raylib/5.0: Forced build from source
Requirements
    glfw/3.4#556ce0bc9e0abc75fe4378b86e566fc4:297149c43b562095879d245f61d9b2e590276ce7#b82809593a92451e158c0bc947b3b3b0 - Cache
    opengl/system#4df6fecde4084386beded3ed0e56e4ea:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a79e5e - Cache
    raylib/5.0#deff1cef784b3804aba650d395ca9461:a8e74be8430e9f90213da4e5f4c5176b7c8a3a85 - Build

======== Installing packages ========
opengl/system: Already installed! (1 of 3)
glfw/3.4: Already installed! (2 of 3)

-------- Installing package raylib/5.0 (3 of 3) --------
raylib/5.0: Building from source
raylib/5.0: Package raylib/5.0:a8e74be8430e9f90213da4e5f4c5176b7c8a3a85
raylib/5.0: Copying sources to build folder
raylib/5.0: Building your package in C:\Users\-\.conan2\p\b\rayli8601c6c56e784\b
raylib/5.0: Calling generate()
raylib/5.0: Generators folder: C:\Users\-\.conan2\p\b\rayli8601c6c56e784\b\build\generators
raylib/5.0: CMakeToolchain generated: conan_toolchain.cmake
raylib/5.0: CMakeToolchain generated: C:\Users\-\.conan2\p\b\rayli8601c6c56e784\b\build\generators\CMakePresets.json
raylib/5.0: CMakeToolchain generated: C:\Users\-\.conan2\p\b\rayli8601c6c56e784\b\src\CMakeUserPresets.json
raylib/5.0: CMakeDeps necessary find_package() and targets for your CMakeLists.txt
    find_package(glfw3)
    find_package(opengl_system)
    target_link_libraries(... glfw opengl::opengl)
raylib/5.0: Generating aggregated env files
raylib/5.0: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat']
raylib/5.0: Calling build()
raylib/5.0: Running CMake.configure()
raylib/5.0: RUN: cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p" -DCMAKE_POLICY_DEFAULT_CMP0054="NEW" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:/Users/-/.conan2/p/b/rayli8601c6c56e784/b/src"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Using Conan toolchain: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/b/build/generators/conan_toolchain.cmake
-- Conan toolchain: CMAKE_GENERATOR_TOOLSET=v143
-- Conan toolchain: Setting CMAKE_MSVC_RUNTIME_LIBRARY=$<$<CONFIG:Release>:MultiThreadedDLL>
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.39.33523.0
-- The CXX compiler identification is MSVC 19.39.33523.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_HAS_THOSE_TOGGLES
-- Performing Test COMPILER_HAS_THOSE_TOGGLES - Failed
-- Testing if -Werror=pointer-arith can be used -- Failed
-- Testing if -Werror=implicit-function-declaration can be used -- Failed
-- Testing if -fno-strict-aliasing can be used -- Failed
-- Conan: Target declared 'glfw'
-- Conan: Target declared 'opengl::opengl'
-- Using external GLFW
-- Audio Backend: miniaudio
-- Building raylib static library
-- USE_AUDIO=ON
-- SUPPORT_MODULE_RSHAPES=ON
-- SUPPORT_MODULE_RTEXTURES=ON
-- SUPPORT_MODULE_RTEXT=ON
-- SUPPORT_MODULE_RMODELS=ON
-- SUPPORT_MODULE_RAUDIO=ON
-- SUPPORT_CAMERA_SYSTEM=ON
-- SUPPORT_GESTURES_SYSTEM=ON
-- SUPPORT_MOUSE_GESTURES=ON
-- SUPPORT_SSH_KEYBOARD_RPI=ON
-- SUPPORT_DEFAULT_FONT=ON
-- SUPPORT_SCREEN_CAPTURE=ON
-- SUPPORT_GIF_RECORDING=ON
-- SUPPORT_EVENTS_WAITING=ON
-- SUPPORT_WINMM_HIGHRES_TIMER=ON
-- SUPPORT_COMPRESSION_API=ON
-- SUPPORT_CUSTOM_FRAME_CONTROL=ON
-- SUPPORT_QUADS_DRAW_MODE=ON
-- SUPPORT_IMAGE_EXPORT=ON
-- SUPPORT_IMAGE_GENERATION=ON
-- SUPPORT_IMAGE_MANIPULATION=ON
-- SUPPORT_FILEFORMAT_PNG=ON
-- SUPPORT_FILEFORMAT_DDS=ON
-- SUPPORT_FILEFORMAT_HDR=ON
-- SUPPORT_FILEFORMAT_GIF=ON
-- SUPPORT_FILEFORMAT_QOI=ON
-- SUPPORT_FILEFORMAT_FNT=ON
-- SUPPORT_FILEFORMAT_TTF=ON
-- SUPPORT_TEXT_MANIPULATION=ON
-- SUPPORT_MESH_GENERATION=ON
-- SUPPORT_FILEFORMAT_OBJ=ON
-- SUPPORT_FILEFORMAT_MTL=ON
-- SUPPORT_FILEFORMAT_IQM=ON
-- SUPPORT_FILEFORMAT_GLTF=ON
-- SUPPORT_FILEFORMAT_VOX=ON
-- SUPPORT_FILEFORMAT_M3D=ON
-- SUPPORT_FILEFORMAT_WAV=ON
-- SUPPORT_FILEFORMAT_OGG=ON
-- SUPPORT_FILEFORMAT_XM=ON
-- SUPPORT_FILEFORMAT_MOD=ON
-- SUPPORT_FILEFORMAT_MP3=ON
-- SUPPORT_FILEFORMAT_QOA=ON
-- SUPPORT_STANDARD_FILEIO=ON
-- SUPPORT_TRACELOG=ON
-- Generated config types: Debug;Release;MinSizeRel;RelWithDebInfo
-- Compiling with the flags:
--   PLATFORM=PLATFORM_DESKTOP
--   GRAPHICS=GRAPHICS_API_OPENGL_33
-- Configuring done (5.9s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/b/build

raylib/5.0: Running CMake.build()
raylib/5.0: RUN: cmake --build "C:\Users\-\.conan2\p\b\rayli8601c6c56e784\b\build" --config Release
MSBuild-Version 17.10.4+10fbfbf2e für .NET Framework

  1>Checking Build System
  Building Custom Rule C:/Users/-/.conan2/p/b/rayli8601c6c56e784/b/src/src/CMakeLists.txt
  rcore.c
  rmodels.c
  rshapes.c
  rtext.c
  rtextures.c
  utils.c
  raudio.c
  raylib.vcxproj -> C:\Users\-\.conan2\p\b\rayli8601c6c56e784\b\build\raylib\Release\raylib.lib
  Building Custom Rule C:/Users/-/.conan2/p/b/rayli8601c6c56e784/b/src/CMakeLists.txt

raylib/5.0: Package 'a8e74be8430e9f90213da4e5f4c5176b7c8a3a85' built
raylib/5.0: Build folder C:\Users\-\.conan2\p\b\rayli8601c6c56e784\b\build
raylib/5.0: Generating the package
raylib/5.0: Packaging in folder C:\Users\-\.conan2\p\b\rayli8601c6c56e784\p
raylib/5.0: Calling package()
raylib/5.0: Running CMake.install()
raylib/5.0: RUN: cmake --install "C:\Users\-\.conan2\p\b\rayli8601c6c56e784\b\build" --config Release --prefix "C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p"
-- Installing: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p/lib/raylib.lib
-- Installing: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p/include/raylib.h
-- Installing: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p/include/rlgl.h
-- Installing: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p/include/raymath.h
-- Installing: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p/lib/pkgconfig/raylib.pc
-- Installing: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p/lib/cmake/raylib/raylib-config-version.cmake
-- Installing: C:/Users/-/.conan2/p/b/rayli8601c6c56e784/p/lib/cmake/raylib/raylib-config.cmake

raylib/5.0: package(): Packaged 3 '.h' files: raylib.h, raymath.h, rlgl.h
raylib/5.0: package(): Packaged 1 '.lib' file: raylib.lib
raylib/5.0: package(): Packaged 1 '.cmake' file: conan-official-raylib-targets.cmake
raylib/5.0: package(): Packaged 1 file: LICENSE
raylib/5.0: Created package revision 1ae161935f49b906fdde08bf5e928cfb
raylib/5.0: Package 'a8e74be8430e9f90213da4e5f4c5176b7c8a3a85' created
raylib/5.0: Full package reference: raylib/5.0#deff1cef784b3804aba650d395ca9461:a8e74be8430e9f90213da4e5f4c5176b7c8a3a85#1ae161935f49b906fdde08bf5e928cfb
raylib/5.0: Package folder C:\Users\-\.conan2\p\b\rayli8601c6c56e784\p
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'cpp_info.filenames' used in: glfw/3.4, opengl/system
WARN: deprecated:     'cpp_info.names' used in: glfw/3.4
WARN: deprecated:     'cpp_info.build_modules' used in: raylib/5.0, glfw/3.4

======== Launching test_package ========

======== Computing dependency graph ========
Graph root
    raylib/5.0 (test package): C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\test_package\conanfile.py
Requirements
    glfw/3.4#556ce0bc9e0abc75fe4378b86e566fc4 - Cache
    opengl/system#4df6fecde4084386beded3ed0e56e4ea - Cache
    raylib/5.0#deff1cef784b3804aba650d395ca9461 - Cache

======== Computing necessary packages ========
Requirements
    glfw/3.4#556ce0bc9e0abc75fe4378b86e566fc4:297149c43b562095879d245f61d9b2e590276ce7#b82809593a92451e158c0bc947b3b3b0 - Cache
    opengl/system#4df6fecde4084386beded3ed0e56e4ea:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a79e5e - Cache
    raylib/5.0#deff1cef784b3804aba650d395ca9461:a8e74be8430e9f90213da4e5f4c5176b7c8a3a85#1ae161935f49b906fdde08bf5e928cfb - Cache

======== Installing packages ========
opengl/system: Already installed! (1 of 3)
glfw/3.4: Already installed! (2 of 3)
raylib/5.0: Already installed! (3 of 3)
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated:     'cpp_info.filenames' used in: glfw/3.4, opengl/system
WARN: deprecated:     'cpp_info.names' used in: glfw/3.4
WARN: deprecated:     'cpp_info.build_modules' used in: raylib/5.0, glfw/3.4

======== Testing the package ========
Removing previously existing 'test_package' build folder: C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release
raylib/5.0 (test package): Test package build: build\msvc-193-x86_64-20-release
raylib/5.0 (test package): Test package build folder: C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release
raylib/5.0 (test package): Writing generators to C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release\generators
raylib/5.0 (test package): Generator 'CMakeToolchain' calling 'generate()'
raylib/5.0 (test package): CMakeToolchain generated: conan_toolchain.cmake
raylib/5.0 (test package): CMakeToolchain generated: C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release\generators\CMakePresets.json
raylib/5.0 (test package): CMakeToolchain generated: C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\test_package\CMakeUserPresets.json
raylib/5.0 (test package): Generator 'CMakeDeps' calling 'generate()'
raylib/5.0 (test package): CMakeDeps necessary find_package() and targets for your CMakeLists.txt
    find_package(raylib)
    target_link_libraries(... raylib)
raylib/5.0 (test package): Generator 'VirtualRunEnv' calling 'generate()'
raylib/5.0 (test package): Generating aggregated env files
raylib/5.0 (test package): Generated aggregated env files: ['conanrun.bat', 'conanbuild.bat']

======== Testing the package: Building ========
raylib/5.0 (test package): Calling build()
raylib/5.0 (test package): Running CMake.configure()
raylib/5.0 (test package): RUN: cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/-/Desktop/Dateien/scriipts/cpp/libs/conan-center-index/recipes/raylib/all/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:/Users/-/Desktop/Dateien/scriipts/cpp/libs/conan-center-index/recipes/raylib/all/test_package"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Using Conan toolchain: C:/Users/-/Desktop/Dateien/scriipts/cpp/libs/conan-center-index/recipes/raylib/all/test_package/build/msvc-193-x86_64-20-release/generators/conan_toolchain.cmake
-- Conan toolchain: CMAKE_GENERATOR_TOOLSET=v143
-- Conan toolchain: Setting CMAKE_MSVC_RUNTIME_LIBRARY=$<$<CONFIG:Release>:MultiThreadedDLL>
-- Conan toolchain: C++ Standard 20 with extensions OFF
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.39.33523.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Conan: Target declared 'raylib'
-- Conan: Target declared 'glfw'
-- Conan: Target declared 'opengl::opengl'
-- Configuring done (2.9s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/-/Desktop/Dateien/scriipts/cpp/libs/conan-center-index/recipes/raylib/all/test_package/build/msvc-193-x86_64-20-release

raylib/5.0 (test package): Running CMake.build()
raylib/5.0 (test package): RUN: cmake --build "C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release" --config Release
MSBuild-Version 17.10.4+10fbfbf2e für .NET Framework

  1>Checking Build System
  Building Custom Rule C:/Users/-/Desktop/Dateien/scriipts/cpp/libs/conan-center-index/recipes/raylib/all/test_package/CMakeLists.txt
  test_package.c
  test_package.vcxproj -> C:\Users\-\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release\Release\test_package.exe
  Building Custom Rule C:/Users/-/Desktop/Dateien/scriipts/cpp/libs/conan-center-index/recipes/raylib/all/test_package/CMakeLists.txt


======== Testing the package: Executing test ========
raylib/5.0 (test package): Running test()
raylib/5.0 (test package): RUN: Release\test_package
unit sphere collides with itself!


@conan-center-bot
Copy link
Collaborator

Conan v1 pipeline ✔️

All green in build 9 (8d053fe35c76071bf5c30b405ba3c9466422fed7):

  • raylib/3.5.0:
    Built 20 packages out of 22 (All logs)

  • raylib/4.0.0:
    Built 20 packages out of 22 (All logs)

  • raylib/5.0:
    Built 20 packages out of 22 (All logs)


Conan v2 pipeline ✔️

Note: Conan v2 builds are now mandatory. Please read our discussion about it.

All green in build 9 (8d053fe35c76071bf5c30b405ba3c9466422fed7):

  • raylib/5.0:
    All packages built successfully! (All logs)

  • raylib/4.0.0:
    All packages built successfully! (All logs)

  • raylib/3.5.0:
    All packages built successfully! (All logs)

Copy link
Member

@uilianries uilianries left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Julianiolo Thank you for updating your PR.

There are still points that need few changes:

  • The raylib project does not use customize build by default, neither other package managers that I visited are using it by default, so I don't recommend doing it by default as will affect every user.
  • In case needing to extra cmake definitions, you still can use Conan config, e.g:
conan install ... -c -c tools.cmake.cmaketoolchain:extra_variables='{"SUPPORT_CAMERA_SYSTEM": "ON", "SUPPORT_GESTURES_SYSTEM": "ON"}'

The same can be part of your profile. You can obtain more information in the CMakeToolchain and Config docs page.

Still, it will not affect you package ID directly, so you can enforce it by using the tools.info.package_id:confs:

-c tools.info.package_id:confs='["tools.cmake.cmaketoolchain:extra_variables"]'

This will tell Conan to use extra_variables as part of the Package ID.

  • The options module_raudio, events_waiting, and custom_frame_control are directly affected by customize_build, so I would suggest removing them in configure, as you can not change them in case customize_build is False:
def configure(self):
    if not self.customize_build:
        del module_raudio
        del events_waiting
        del custom_frame_control
  • You do not need to parse to "ON"/"OFF" those options values, the boolean values work perfectly with CMake, we have being using it since many years and is compatible with both CMake 2.8 and +3.x

recipes/raylib/all/conanfile.py Outdated Show resolved Hide resolved
recipes/raylib/all/conanfile.py Outdated Show resolved Hide resolved
Comment on lines 86 to 98

tc.variables["CUSTOMIZE_BUILD"] = "ON"
on_off = lambda x: "ON" if x else "OFF"
tc.variables["SUPPORT_MODULE_RAUDIO"] = on_off(self.options.module_raudio)

# this makes it include the headers rcamera.h, rgesture.h and rprand.h
tc.variables["SUPPORT_CAMERA_SYSTEM"] = "ON"
tc.variables["SUPPORT_GESTURES_SYSTEM"] = "ON"
tc.variables["SUPPORT_RPRAND_GENERATOR"] = "ON"

tc.variables["SUPPORT_EVENTS_WAITING"] = on_off(self.options.events_waiting)
tc.variables["SUPPORT_CUSTOM_FRAME_CONTROL"] = on_off(self.options.custom_frame_control)

Copy link
Member

@uilianries uilianries Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tc.variables["CUSTOMIZE_BUILD"] = "ON"
on_off = lambda x: "ON" if x else "OFF"
tc.variables["SUPPORT_MODULE_RAUDIO"] = on_off(self.options.module_raudio)
# this makes it include the headers rcamera.h, rgesture.h and rprand.h
tc.variables["SUPPORT_CAMERA_SYSTEM"] = "ON"
tc.variables["SUPPORT_GESTURES_SYSTEM"] = "ON"
tc.variables["SUPPORT_RPRAND_GENERATOR"] = "ON"
tc.variables["SUPPORT_EVENTS_WAITING"] = on_off(self.options.events_waiting)
tc.variables["SUPPORT_CUSTOM_FRAME_CONTROL"] = on_off(self.options.custom_frame_control)
tc.variables["CUSTOMIZE_BUILD"] = self.options.customize_build
if self.options.customize_build:
tc.variables["SUPPORT_MODULE_RAUDIO"] = self.options.get_safe("module_raudio")
tc.variables["SUPPORT_EVENTS_WAITING"] = self.options.get_safe("events_waiting")
tc.variables["SUPPORT_CUSTOM_FRAME_CONTROL"] = self.options.get_safe("custom_frame_control")

I would ask to remove this forced customization and simplify it instead:

recipes/raylib/all/conanfile.py Outdated Show resolved Hide resolved
@Julianiolo
Copy link
Contributor Author

Julianiolo commented Sep 19, 2024

@uilianries huge thanks for taking the time to review this so thoroughly :)

I see you removed the

tc.variables["SUPPORT_CAMERA_SYSTEM"]    = "ON"
tc.variables["SUPPORT_GESTURES_SYSTEM"]  = "ON"
tc.variables["SUPPORT_RPRAND_GENERATOR"] = "ON"

This was designed as a fix to #24472, but I guess it does not work without the customized build. So maybe doing it like the PR suggests is better?

Btw, does turning on customize build by itself even do anything?

Build log

======== Exporting recipe to the cache ========
raylib/5.0: Exporting package recipe: C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\conanfile.py
raylib/5.0: exports: File 'conandata.yml' found. Exporting it...
raylib/5.0: Calling export_sources()
raylib/5.0: Copied 1 '.yml' file: conandata.yml
raylib/5.0: Copied 1 '.py' file: conanfile.py
raylib/5.0: Exported to cache folder: C:\Users-.conan2\p\rayli84d1a61af1923\e
raylib/5.0: Exported: raylib/5.0#0d00b459310f02ea8bac9d7aa02aec2d (2024-09-19 14:38:17 UTC)

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows
[options]
raylib/:custom_frame_control=True
raylib/
:customize_build=True
raylib/*:events_waiting=True

Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=20
compiler.runtime=dynamic
compiler.runtime_type=Release
compiler.version=193
os=Windows

======== Computing dependency graph ========
Graph root
cli
Requirements
glfw/3.4#556ce0bc9e0abc75fe4378b86e566fc4 - Cache
opengl/system#4df6fecde4084386beded3ed0e56e4ea - Cache
raylib/5.0#0d00b459310f02ea8bac9d7aa02aec2d - Cache

======== Computing necessary packages ========
raylib/5.0: Forced build from source
Requirements
glfw/3.4#556ce0bc9e0abc75fe4378b86e566fc4:297149c43b562095879d245f61d9b2e590276ce7#b82809593a92451e158c0bc947b3b3b0 - Cache
opengl/system#4df6fecde4084386beded3ed0e56e4ea:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a79e5e - Cache
raylib/5.0#0d00b459310f02ea8bac9d7aa02aec2d:ddd4486cb5134320eb1ec58b8e53a4272a2d2fad - Build

======== Installing packages ========
opengl/system: Already installed! (1 of 3)
glfw/3.4: Already installed! (2 of 3)

-------- Installing package raylib/5.0 (3 of 3) --------
raylib/5.0: Building from source
raylib/5.0: Package raylib/5.0:ddd4486cb5134320eb1ec58b8e53a4272a2d2fad
raylib/5.0: Copying sources to build folder
raylib/5.0: Building your package in C:\Users-.conan2\p\b\rayliee81208d77cdb\b
raylib/5.0: Calling generate()
raylib/5.0: Generators folder: C:\Users-.conan2\p\b\rayliee81208d77cdb\b\build\generators
raylib/5.0: CMakeToolchain generated: conan_toolchain.cmake
raylib/5.0: CMakeToolchain generated: C:\Users-.conan2\p\b\rayliee81208d77cdb\b\build\generators\CMakePresets.json
raylib/5.0: CMakeToolchain generated: C:\Users-.conan2\p\b\rayliee81208d77cdb\b\src\CMakeUserPresets.json
raylib/5.0: CMakeDeps necessary find_package() and targets for your CMakeLists.txt
find_package(glfw3)
find_package(opengl_system)
target_link_libraries(... glfw opengl::opengl)
raylib/5.0: Generating aggregated env files
raylib/5.0: Generated aggregated env files: ['conanbuild.bat', 'conanrun.bat']
raylib/5.0: Calling build()
raylib/5.0: Running CMake.configure()
raylib/5.0: RUN: cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p" -DCMAKE_POLICY_DEFAULT_CMP0054="NEW" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:/Users/-/.conan2/p/b/rayliee81208d77cdb/b/src"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Using Conan toolchain: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/b/build/generators/conan_toolchain.cmake
-- Conan toolchain: CMAKE_GENERATOR_TOOLSET=v143
-- Conan toolchain: Setting CMAKE_MSVC_RUNTIME_LIBRARY=$<$CONFIG:Release:MultiThreadedDLL>
-- Conan toolchain: Setting BUILD_SHARED_LIBS = OFF
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.39.33523.0
-- The CXX compiler identification is MSVC 19.39.33523.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_HAS_THOSE_TOGGLES
-- Performing Test COMPILER_HAS_THOSE_TOGGLES - Failed
-- Testing if -Werror=pointer-arith can be used -- Failed
-- Testing if -Werror=implicit-function-declaration can be used -- Failed
-- Testing if -fno-strict-aliasing can be used -- Failed
-- Conan: Target declared 'glfw'
-- Conan: Target declared 'opengl::opengl'
-- Using external GLFW
-- Audio Backend: miniaudio
-- Building raylib static library
-- USE_AUDIO=ON
-- SUPPORT_MODULE_RSHAPES=ON
-- SUPPORT_MODULE_RTEXTURES=ON
-- SUPPORT_MODULE_RTEXT=ON
-- SUPPORT_MODULE_RMODELS=ON
-- SUPPORT_MODULE_RAUDIO=True
-- SUPPORT_CAMERA_SYSTEM=ON
-- SUPPORT_GESTURES_SYSTEM=ON
-- SUPPORT_MOUSE_GESTURES=ON
-- SUPPORT_SSH_KEYBOARD_RPI=ON
-- SUPPORT_DEFAULT_FONT=ON
-- SUPPORT_SCREEN_CAPTURE=ON
-- SUPPORT_GIF_RECORDING=ON
-- SUPPORT_EVENTS_WAITING=True
-- SUPPORT_WINMM_HIGHRES_TIMER=ON
-- SUPPORT_COMPRESSION_API=ON
-- SUPPORT_CUSTOM_FRAME_CONTROL=True
-- SUPPORT_QUADS_DRAW_MODE=ON
-- SUPPORT_IMAGE_EXPORT=ON
-- SUPPORT_IMAGE_GENERATION=ON
-- SUPPORT_IMAGE_MANIPULATION=ON
-- SUPPORT_FILEFORMAT_PNG=ON
-- SUPPORT_FILEFORMAT_DDS=ON
-- SUPPORT_FILEFORMAT_HDR=ON
-- SUPPORT_FILEFORMAT_GIF=ON
-- SUPPORT_FILEFORMAT_QOI=ON
-- SUPPORT_FILEFORMAT_FNT=ON
-- SUPPORT_FILEFORMAT_TTF=ON
-- SUPPORT_TEXT_MANIPULATION=ON
-- SUPPORT_MESH_GENERATION=ON
-- SUPPORT_FILEFORMAT_OBJ=ON
-- SUPPORT_FILEFORMAT_MTL=ON
-- SUPPORT_FILEFORMAT_IQM=ON
-- SUPPORT_FILEFORMAT_GLTF=ON
-- SUPPORT_FILEFORMAT_VOX=ON
-- SUPPORT_FILEFORMAT_M3D=ON
-- SUPPORT_FILEFORMAT_WAV=ON
-- SUPPORT_FILEFORMAT_OGG=ON
-- SUPPORT_FILEFORMAT_XM=ON
-- SUPPORT_FILEFORMAT_MOD=ON
-- SUPPORT_FILEFORMAT_MP3=ON
-- SUPPORT_FILEFORMAT_QOA=ON
-- SUPPORT_STANDARD_FILEIO=ON
-- SUPPORT_TRACELOG=ON
-- Generated config types: Debug;Release;MinSizeRel;RelWithDebInfo
-- Compiling with the flags:
-- PLATFORM=PLATFORM_DESKTOP
-- GRAPHICS=GRAPHICS_API_OPENGL_33
-- Configuring done (5.4s)
-- Generating done (0.1s)
-- Build files have been written to: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/b/build

raylib/5.0: Running CMake.build()
raylib/5.0: RUN: cmake --build "C:\Users-.conan2\p\b\rayliee81208d77cdb\b\build" --config Release
MSBuild-Version 17.10.4+10fbfbf2e für .NET Framework

1>Checking Build System
Building Custom Rule C:/Users/-/.conan2/p/b/rayliee81208d77cdb/b/src/src/CMakeLists.txt
rcore.c
rmodels.c
rshapes.c
rtext.c
rtextures.c
utils.c
raudio.c
raylib.vcxproj -> C:\Users-.conan2\p\b\rayliee81208d77cdb\b\build\raylib\Release\raylib.lib
Building Custom Rule C:/Users/-/.conan2/p/b/rayliee81208d77cdb/b/src/CMakeLists.txt

raylib/5.0: Package 'ddd4486cb5134320eb1ec58b8e53a4272a2d2fad' built
raylib/5.0: Build folder C:\Users-.conan2\p\b\rayliee81208d77cdb\b\build
raylib/5.0: Generating the package
raylib/5.0: Packaging in folder C:\Users-.conan2\p\b\rayliee81208d77cdb\p
raylib/5.0: Calling package()
raylib/5.0: Running CMake.install()
raylib/5.0: RUN: cmake --install "C:\Users-.conan2\p\b\rayliee81208d77cdb\b\build" --config Release --prefix "C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p"
-- Installing: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p/lib/raylib.lib
-- Installing: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p/include/raylib.h
-- Installing: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p/include/rlgl.h
-- Installing: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p/include/raymath.h
-- Installing: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p/lib/pkgconfig/raylib.pc
-- Installing: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p/lib/cmake/raylib/raylib-config-version.cmake
-- Installing: C:/Users/-/.conan2/p/b/rayliee81208d77cdb/p/lib/cmake/raylib/raylib-config.cmake

raylib/5.0: package(): Packaged 3 '.h' files: raylib.h, raymath.h, rlgl.h
raylib/5.0: package(): Packaged 1 '.lib' file: raylib.lib
raylib/5.0: package(): Packaged 1 '.cmake' file: conan-official-raylib-targets.cmake
raylib/5.0: package(): Packaged 1 file: LICENSE
raylib/5.0: Created package revision f7dce880cd0d8d4d1922ad03e34d549b
raylib/5.0: Package 'ddd4486cb5134320eb1ec58b8e53a4272a2d2fad' created
raylib/5.0: Full package reference: raylib/5.0#0d00b459310f02ea8bac9d7aa02aec2d:ddd4486cb5134320eb1ec58b8e53a4272a2d2fad#f7dce880cd0d8d4d1922ad03e34d549b
raylib/5.0: Package folder C:\Users-.conan2\p\b\rayliee81208d77cdb\p
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated: 'cpp_info.filenames' used in: glfw/3.4, opengl/system
WARN: deprecated: 'cpp_info.names' used in: glfw/3.4
WARN: deprecated: 'cpp_info.build_modules' used in: glfw/3.4, raylib/5.0

======== Launching test_package ========

======== Computing dependency graph ========
Graph root
raylib/5.0 (test package): C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\test_package\conanfile.py
Requirements
glfw/3.4#556ce0bc9e0abc75fe4378b86e566fc4 - Cache
opengl/system#4df6fecde4084386beded3ed0e56e4ea - Cache
raylib/5.0#0d00b459310f02ea8bac9d7aa02aec2d - Cache

======== Computing necessary packages ========
Requirements
glfw/3.4#556ce0bc9e0abc75fe4378b86e566fc4:297149c43b562095879d245f61d9b2e590276ce7#b82809593a92451e158c0bc947b3b3b0 - Cache
opengl/system#4df6fecde4084386beded3ed0e56e4ea:da39a3ee5e6b4b0d3255bfef95601890afd80709#0ba8627bd47edc3a501e8f0eb9a79e5e - Cache
raylib/5.0#0d00b459310f02ea8bac9d7aa02aec2d:ddd4486cb5134320eb1ec58b8e53a4272a2d2fad#f7dce880cd0d8d4d1922ad03e34d549b - Cache

======== Installing packages ========
opengl/system: Already installed! (1 of 3)
glfw/3.4: Already installed! (2 of 3)
raylib/5.0: Already installed! (3 of 3)
WARN: deprecated: Usage of deprecated Conan 1.X features that will be removed in Conan 2.X:
WARN: deprecated: 'cpp_info.filenames' used in: glfw/3.4, opengl/system
WARN: deprecated: 'cpp_info.names' used in: glfw/3.4
WARN: deprecated: 'cpp_info.build_modules' used in: glfw/3.4, raylib/5.0

======== Testing the package ========
Removing previously existing 'test_package' build folder: C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release
raylib/5.0 (test package): Test package build: build\msvc-193-x86_64-20-release
raylib/5.0 (test package): Test package build folder: C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release
raylib/5.0 (test package): Writing generators to C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release\generators
raylib/5.0 (test package): Generator 'CMakeToolchain' calling 'generate()'
raylib/5.0 (test package): CMakeToolchain generated: conan_toolchain.cmake
raylib/5.0 (test package): CMakeToolchain generated: C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release\generators\CMakePresets.json
raylib/5.0 (test package): CMakeToolchain generated: C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\test_package\CMakeUserPresets.json
raylib/5.0 (test package): Generator 'CMakeDeps' calling 'generate()'
raylib/5.0 (test package): CMakeDeps necessary find_package() and targets for your CMakeLists.txt
find_package(raylib)
target_link_libraries(... raylib)
raylib/5.0 (test package): Generator 'VirtualRunEnv' calling 'generate()'
raylib/5.0 (test package): Generating aggregated env files
raylib/5.0 (test package): Generated aggregated env files: ['conanrun.bat', 'conanbuild.bat']

======== Testing the package: Building ========
raylib/5.0 (test package): Calling build()
raylib/5.0 (test package): Running CMake.configure()
raylib/5.0 (test package): RUN: cmake -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE="generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="C:/Users/--/cpp/libs/conan-center-index/recipes/raylib/all/test_package" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" "C:/Users/--/cpp/libs/conan-center-index/recipes/raylib/all/test_package"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.

Update the VERSION argument value or use a ... suffix to tell
CMake that the project does not need compatibility with older versions.

-- Using Conan toolchain: C:/Users/--/cpp/libs/conan-center-index/recipes/raylib/all/test_package/build/msvc-193-x86_64-20-release/generators/conan_toolchain.cmake
-- Conan toolchain: CMAKE_GENERATOR_TOOLSET=v143
-- Conan toolchain: Setting CMAKE_MSVC_RUNTIME_LIBRARY=$<$CONFIG:Release:MultiThreadedDLL>
-- Conan toolchain: C++ Standard 20 with extensions OFF
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.39.33523.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Conan: Target declared 'raylib'
-- Conan: Target declared 'glfw'
-- Conan: Target declared 'opengl::opengl'
-- Configuring done (2.6s)
-- Generating done (0.0s)
-- Build files have been written to: C:/Users/--/cpp/libs/conan-center-index/recipes/raylib/all/test_package/build/msvc-193-x86_64-20-release

raylib/5.0 (test package): Running CMake.build()
raylib/5.0 (test package): RUN: cmake --build "C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release" --config Release
MSBuild-Version 17.10.4+10fbfbf2e für .NET Framework

1>Checking Build System
Building Custom Rule C:/Users/--/cpp/libs/conan-center-index/recipes/raylib/all/test_package/CMakeLists.txt
test_package.c
test_package.vcxproj -> C:\Users--\cpp\libs\conan-center-index\recipes\raylib\all\test_package\build\msvc-193-x86_64-20-release\Release\test_package.exe
Building Custom Rule C:/Users/--/cpp/libs/conan-center-index/recipes/raylib/all/test_package/CMakeLists.txt

======== Testing the package: Executing test ========
raylib/5.0 (test package): Running test()
raylib/5.0 (test package): RUN: Release\test_package
unit sphere collides with itself!

@uilianries
Copy link
Member

@Julianiolo Thank you for pointing that detail! I'll discuss with Abril about it!

Btw, does turning on customize build by itself even do anything?

Yes, the upstream uses cmake_dependent_option to enable a bunch of options in case customize_build is active. For instance: https://github.com/raysan5/raylib/blob/5.0/CMakeOptions.txt#L31

@Julianiolo
Copy link
Contributor Author

@uilianries my question is if enabling customize build actually changes anything in the result. Shouldn't it just produce the exact same thing if no other options are changed?

@uilianries
Copy link
Member

@Julianiolo No, cmake_dependent_option only enables the target option, in case the second condition is true as well. Example:

https://github.com/raysan5/raylib/blob/5.0/CMakeOptions.txt#L38

cmake_dependent_option(SUPPORT_CAMERA_SYSTEM "Provide camera module (rcamera.h) with multiple predefined cameras: free, 1st/3rd person, orbital" ON CUSTOMIZE_BUILD ON)

The option SUPPORT_CAMERA_SYSTEM is only available and configured as ON by default, in case CUSTOMIZE_BUILD is ON. In case CUSTOMIZE_BUILD is OFF, then, the SUPPORT_CAMERA_SYSTEM is OFF and hidden for usage.

More information: https://cmake.org/cmake/help/latest/module/CMakeDependentOption.html

@Julianiolo
Copy link
Contributor Author

Julianiolo commented Sep 20, 2024

@uilianries But shouldn't it still be ON if customize build is OFF, due to <force> being ON? So in that case customize build does nothing besides making that option available to the user, right?

@uilianries
Copy link
Member

@Julianiolo Correct, but you may consider https://github.com/raysan5/raylib/blob/5.0/cmake/CompileDefinitions.cmake#L12

Without CUSTOMIZE_BUILD=ON, no other option will be used and does not matter their default value.


After talking with @AbrilRBS, we considered exposing those 3 options SUPPORT_CAMERA_SYSTEM, SUPPORT_GESTURES_SYSTEM and SUPPORT_RPRAND_GENERATOR in self.options, so users can control that. Still, they need customize_build=True to be available. Please, update the recipe according.

Speaking about the PR #24472, that PR is copying those extra headers, but the upstream does not copy and will not (It was asked directly to the upstream). So, do you need those headers as well? In case positive, will need to copy them according to the active option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants