(Build system improvement) Add optional CMake feature flag to prefer/search Linux system dependencies instead of bundled #400
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hardBSDk on 2026-10-02T18:21:41Z.
No description provided.
Imported from boykopovar/AnyPS5. Originally posted by arreina on 2026-10-03T18:36:07Z.
I could take this on, but would like to check the scope first, since it touches the root CMake.
From the submodules, only some have usable system packages on common distributions:
libsdl2-dev,libfreetype-dev,libvulkan-dev,glslang-dev,spirv-toolson Ubuntu).ffmpeg.patch, so a system FFmpeg would not match it.A single opt-in option (e.g.
ANYPS5_USE_SYSTEM_DEPS, off by default) that switches the first group tofind_package/pkg-configand keeps the rest bundled would leave the default build unchanged. The static-linking setup would also need a look, since system packages are shared libraries.@boykopovar is that a direction you'd accept, or would you rather keep all dependencies bundled?
Imported from boykopovar/AnyPS5. Originally posted by hardBSDk on 2026-10-04T11:43:16Z.
@arreina This hybrid approach is good.
Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-10-06T05:07:54Z.
Sorry for the long wait. I don't mind the ANYPS5_USE_SYSTEM_DEPS flag, which is disabled by default. If this flag is enabled and the package can't be found, I want it to fail with an error during the CMake reload or build process, not during runtime, and there should be no automatic switch to building from source. Are you planning on making this flag Linux-only, or can you make it work the same way on Windows?
Imported from boykopovar/AnyPS5. Originally posted by 011010 on 2026-10-06T16:13:55Z.
If @arreina is not already on it, I can take this.
On your second question (Linux-only, or the same on Windows): I would keep it platform-neutral. Each package would be resolved with
find_package(... CONFIG)and, on Linux,pkg_check_modulesfor the ones that ship a.pc; with the flag on, a missing package fails at configure time and never falls back to the bundled copy. The same flag then works on Windows against a config-mode provider (e.g. vcpkg), which is what a non-distro build there would use anyway. If you would rather keep it Linux-only for a first cut, that is a smaller change, but I do not see a reason to make the interface itself platform-specific.Scope, from what the tree uses today:
SDL2(the top level linksSDL2-static),freetype,Vulkan-HeadersandSPIRV-Headers(header-only include dirs),glslang, andSPIRV-Tools(only built underANYPS5_ENABLE_SPIRV_TOOLS).ffmpeg-core(carriesffmpeg.patch),libjpeg-turbo(built through its own prefix),LibAtrac9andstb(no system packages).One catch worth deciding up front:
ensure_agc_glslang()incore/libs/prx/libSceAgcDriver/CMakeLists.txtrequires the targetsglslang,SPIRVandglslang-standalone. A distroglslangpackage generally does not export those, and usually has noglslang-standalone, so with the flag on the configure has to fail there with a clear message instead of falling through. That is the exact behaviour you asked for, so I would add that check explicitly and name the missing target.Default is unchanged: flag off, bundled submodules, same result as today.
@arreina if you are already on it, say so and I will stay out.
Imported from boykopovar/AnyPS5. Originally posted by arreina on 2026-10-06T16:40:21Z.
@011010 Please go ahead. I'm swamped with work right now and won't have time to take this on, and your scoping, including the glslang target check, is more thorough than mine anyway. Thanks for offering.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:25:14Z.
Closing: #921 added
ANYPS5_USE_SYSTEM_DEPS(off by default), and #2373 exemptscmake/SystemDeps.cmakefrom the conventions check.