Skip to content

Updates for libretro CI#356

Merged
audetto merged 2 commits intoaudetto:masterfrom
zoltanvb:master
Feb 27, 2026
Merged

Updates for libretro CI#356
audetto merged 2 commits intoaudetto:masterfrom
zoltanvb:master

Conversation

@zoltanvb
Copy link

Here are some changes that enabled finally to get all currently configured 7 builds compiling (linux 32/64, windows 32/64, android, ios, macos) https://git.libretro.com/warmenhoven/applewin/-/pipelines/46992

  • enabled submodule usage in .gitlab-ci.yml -- this one shouldn't disturb anyone

I hope also other changes can be taken:

  • changed xxd invocation - old xxd versions do not support -n and will stop the build process, the output seems to be the same though as I checked a few files
  • changed relative symlinks - those break when cloning the repo somewhere not on Github
  • one addition for pcap/slirp was needed for MacOS compilation in the libretro env

- enabled submodule usage
- changed xxd invocation (old xxd instances do not support -n, the output seems to be the same though)
- changed relative symlinks - those break when cloning the repo somewhere not on Github
- one addition for pcap/slirp was needed for MacOS compilation in the libretro env
target_link_libraries(appleii PUBLIC
yaml
minizip
${PCAP_LIBRARIES}
Copy link
Owner

Choose a reason for hiding this comment

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

This can't be here. A lot effort went into allowing the static build to work.

This is anyway a static library, so it should not require these symbols, which are already added to each target project.

I'd rather put here all the static or dynamic libraries needed, but I had an argument with cmake and I lost it.

What is the exact problem?

Copy link
Author

Choose a reason for hiding this comment

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

When the extra libpcap detection was needed, it did not propagate to source/frontends/libretro. I have changed the approach, is it more acceptable this way?

Copy link
Owner

Choose a reason for hiding this comment

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

Still does not make sense to me.

If your change were really needed, how do we explain that PCAP_LIBRARIES and SLIRP_LIBRARIES did not need this so far?

In my version of cmake, there is basically 1 single global scope.

Can you try this: https://github.com/audetto/AppleWin/tree/cmake2 on a brand new build folder.

I get

1 PCAP_LIBRARIES = 
1 SLIRP_LIBRARIES = slirp;glib-2.0

and later

2 PCAP_LIBRARIES = 
2 SLIRP_LIBRARIES = slirp;glib-2.0

which indicates a single global scope.

Copy link
Author

Choose a reason for hiding this comment

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

Tried it.

Printout without the extra PARENT_SCOPE:

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "2.3.0")
-- Checking for one of the modules 'slirp'
CMake Warning at source/CMakeLists.txt:12 (message):
  'libslirp' not found: will try 'libpcap' instead
-- Checking for one of the modules 'libpcap'
Found 'libpcap' via pcap-config
1 PCAP_LIBRARIES = -L/usr/local/lib  -lpcap
1 SLIRP_LIBRARIES = 
Generating header for 'apple2roms': [...]
Generating cpp for 'apple2roms': [...]
2 PCAP_LIBRARIES = 
2 SLIRP_LIBRARIES = 
-- Configuring done (0.3s)
-- Generating done (0.0s)

Printout when the extra PARENT_SCOPE is added:

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "2.3.0")
-- Checking for one of the modules 'slirp'
CMake Warning at source/CMakeLists.txt:12 (message):
  'libslirp' not found: will try 'libpcap' instead
-- Checking for one of the modules 'libpcap'
Found 'libpcap' via pcap-config
1 PCAP_LIBRARIES = -L/usr/local/lib  -lpcap
1 SLIRP_LIBRARIES = 
Generating header for 'apple2roms': [...]
Generating cpp for 'apple2roms': [...]
2 PCAP_LIBRARIES = -L/usr/local/lib  -lpcap
2 SLIRP_LIBRARIES = 
-- Configuring done (0.4s)
-- Generating done (0.0s)

The only plausible explanation I can offer is that pkg_search_module behaves differently, not according to documentation (which says variables are set to calling scope) but somehow setting the found libraries to global scope, and the problem only manifests when the build process hits the pcap-config path.

Copy link
Owner

Choose a reason for hiding this comment

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

Indeed, pkg_search_module seems to create cached variables. So the behaviour would not be the same, but is it anyone's guess what cmake actually does. I will try to revisit this static linking which I never liked.

@audetto audetto merged commit 0b3a4fb into audetto:master Feb 27, 2026
2 checks passed
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.

2 participants