feat(conan): Refactor dependencies management and add base and render stack requirements

This commit is contained in:
2026-01-06 13:58:08 +00:00
parent 793fea5e77
commit 1549fa3675
2 changed files with 67 additions and 27 deletions

View File

@@ -136,11 +136,41 @@ find_package(lua CONFIG REQUIRED)
find_package(CLI11 CONFIG REQUIRED)
find_package(RapidJSON CONFIG REQUIRED)
find_package(EnTT CONFIG REQUIRED)
find_package(bgfx CONFIG QUIET)
find_package(MaterialX CONFIG QUIET)
find_package(assimp CONFIG REQUIRED)
find_package(Bullet CONFIG REQUIRED)
find_package(Vorbis CONFIG REQUIRED)
find_package(glm CONFIG REQUIRED)
find_package(cpptrace REQUIRED)
set(SDL3CPP_RENDER_STACK_LIBS EnTT::EnTT)
if(TARGET bgfx::bgfx)
list(APPEND SDL3CPP_RENDER_STACK_LIBS bgfx::bgfx)
endif()
if(TARGET bx::bx)
list(APPEND SDL3CPP_RENDER_STACK_LIBS bx::bx)
endif()
if(TARGET bimg::bimg)
list(APPEND SDL3CPP_RENDER_STACK_LIBS bimg::bimg)
endif()
set(SDL3CPP_MATERIALX_LIBS)
if(TARGET MaterialX::MaterialX)
list(APPEND SDL3CPP_MATERIALX_LIBS MaterialX::MaterialX)
else()
foreach(candidate IN ITEMS
MaterialX::MaterialXCore
MaterialX::MaterialXFormat
MaterialX::MaterialXGenShader)
if(TARGET ${candidate})
list(APPEND SDL3CPP_MATERIALX_LIBS ${candidate})
endif()
endforeach()
endif()
if(SDL3CPP_MATERIALX_LIBS)
list(APPEND SDL3CPP_RENDER_STACK_LIBS ${SDL3CPP_MATERIALX_LIBS})
endif()
endif()
if(BUILD_SDL3_APP)
@@ -192,7 +222,7 @@ if(BUILD_SDL3_APP)
lua::lua
CLI11::CLI11
rapidjson
EnTT::EnTT
${SDL3CPP_RENDER_STACK_LIBS}
assimp::assimp
Bullet::Bullet
glm::glm

View File

@@ -14,6 +14,36 @@ class SDL3CppConan(ConanFile):
"lua/*:with_tools": False,
}
generators = "CMakeDeps", "VirtualRunEnv"
BASE_REQUIRES = (
"lua/5.4.8",
"sdl/3.2.20",
"vulkan-loader/1.4.313.0",
"vulkan-headers/1.4.313.0",
"vulkan-memory-allocator/3.3.0",
"spirv-tools/1.4.313.0",
"spirv-headers/1.4.313.0",
"shaderc/2025.3",
"cpptrace/1.0.4",
"ogg/1.3.5",
"theora/1.1.1",
"cli11/2.6.0",
"bullet3/3.25",
"box2d/3.1.1",
"assimp/6.0.2",
"glm/1.0.1",
"vorbis/1.3.7",
"rapidjson/cci.20230929",
"lunasvg/3.0.1",
"libvips/8.16.0",
"freetype/2.13.2",
"ffmpeg/8.0.1",
"cairo/1.18.0",
)
RENDER_STACK_REQUIRES = (
"bgfx/1.129.8930-495",
"entt/3.16.0",
"materialx/1.39.1",
)
def configure(self):
self.requires("wayland/1.23.92", override=True)
@@ -36,29 +66,9 @@ class SDL3CppConan(ConanFile):
tc.generate()
def requirements(self):
self.requires("lua/5.4.8")
self.requires("sdl/3.2.20")
self.requires("vulkan-loader/1.4.313.0")
self.requires("vulkan-headers/1.4.313.0")
self.requires("vulkan-memory-allocator/3.3.0")
self.requires("spirv-tools/1.4.313.0")
self.requires("spirv-headers/1.4.313.0")
self.requires("shaderc/2025.3")
self.requires("cpptrace/1.0.4")
self.requires("ogg/1.3.5")
self.requires("theora/1.1.1")
self.requires("cli11/2.6.0")
self.requires("bullet3/3.25")
self.requires("box2d/3.1.1")
self.requires("assimp/6.0.2")
self.requires("glm/1.0.1")
self.requires("vorbis/1.3.7")
self.requires("rapidjson/cci.20230929")
self.requires("bgfx/1.129.8930-495")
self.requires("entt/3.16.0")
self.requires("lunasvg/3.0.1")
self.requires("libvips/8.16.0")
self.requires("freetype/2.13.2")
self.requires("ffmpeg/8.0.1")
self.requires("materialx/1.39.1")
self.requires("cairo/1.18.0")
self._add_requirements(self.BASE_REQUIRES)
self._add_requirements(self.RENDER_STACK_REQUIRES)
def _add_requirements(self, requirements):
for requirement in requirements:
self.requires(requirement)