Skip to content

Make it possible to use a system installation of PhysFS#75

Merged
slouken merged 2 commits into
libsdl-org:mainfrom
pinotree:external-physfs
May 19, 2026
Merged

Make it possible to use a system installation of PhysFS#75
slouken merged 2 commits into
libsdl-org:mainfrom
pinotree:external-physfs

Conversation

@pinotree

Copy link
Copy Markdown
Contributor

Add a new USE_VENDORED_PHYSFS CMake variable to determine whether to use the vendored version of PhysFS (defauling to true to keep the existing behaviour).

In case an external version is needed, detect it with pkg-config, as the CMake targets of a system PhysFS 3.2.0 do not seem to be fully usable. It can be changed later anyway.

Bump the required CMake version to 3.7 to be able to use the imported targets in the PkgConfig CMake module.

Fixes #68

pinotree added 2 commits May 19, 2026 09:13
It is needed to use the imported targets features of the PkgConfig
module.
Add a new USE_VENDORED_PHYSFS CMake variable to determine whether to use
the vendored version of PhysFS (defauling to true to keep the existing
behaviour).

In case an external version is needed, detect it with pkg-config,
as the CMake targets of a system PhysFS 3.2.0 do not seem to be fully
usable. It can be changed later anyway.

Fixes libsdl-org#68
@slouken

slouken commented May 19, 2026

Copy link
Copy Markdown
Contributor

The point of using system physfs is to link with it dynamically. Otherwise you might as well use the vendored version, which has been tested with Maelstrom.

Also, we can't bump CMake past 3.16, or it fails to build on various platforms.

@pinotree

Copy link
Copy Markdown
Contributor Author

The point of using system physfs is to link with it dynamically.

That's exactly what this PR is for:

$ LANG=C readelf -d Debug/Maelstrom | grep NEEDED
 0x0000000000000001 (NEEDED)             Shared library: [libSDL3.so.0]
 0x0000000000000001 (NEEDED)             Shared library: [libphysfs.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

Also, we can't bump CMake past 3.16, or it fails to build on various platforms.

No problem, 3.7 is more than enough for this.

@slouken

slouken commented May 19, 2026

Copy link
Copy Markdown
Contributor

Sorry, I totally misread this PR. Looks good, thanks!

@slouken slouken merged commit 571b3d6 into libsdl-org:main May 19, 2026
3 checks passed
@pinotree pinotree deleted the external-physfs branch May 19, 2026 20:37
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.

Use a system version of physfs

2 participants