Conversation
- 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
source/CMakeLists.txt
Outdated
| target_link_libraries(appleii PUBLIC | ||
| yaml | ||
| minizip | ||
| ${PCAP_LIBRARIES} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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
.gitlab-ci.yml-- this one shouldn't disturb anyoneI hope also other changes can be taken: