Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake: fix build #244

Merged
merged 1 commit into from
Dec 20, 2024
Merged

cmake: fix build #244

merged 1 commit into from
Dec 20, 2024

Conversation

abouvier
Copy link

The slirp library includes <compat/strl.h> but never defines HAVE_STRL. On the other hand libretro-common may be compiled with HAVE_STRL and may rely on the system strlcat/strlcpy functions. This lead to link error because libretro-common is compiled without compat/compat_strl.c while slirp try to use libretro-common strlcat/strlcpy functions.

Use target_link_libraries instead of only target_include_directories, to transmit the definitions of libretro-common to slirp.

@JesseTG
Copy link
Owner

JesseTG commented Dec 20, 2024

Thanks for contributing! Could you please retarget this PR against dev instead of main?

While you're at it, could you tell me a bit about the environment you're building melonDS DS on? I don't recall encountering this issue before.

@JesseTG JesseTG added bug Something isn't working build For issues related to the build (not necessarily automated workflows). labels Dec 20, 2024
@abouvier abouvier changed the base branch from main to dev December 20, 2024 20:56
@abouvier
Copy link
Author

abouvier commented Dec 20, 2024

I'm using this recipe on the default Arch Linux build environment. I guess the files compilation order can mask the error, but you can force the fail with -Wl,-z,defs in LDFLAGS.

strlcat/strlcpy are provided by glibc since version 2.38.

@JesseTG JesseTG self-assigned this Dec 20, 2024
@JesseTG
Copy link
Owner

JesseTG commented Dec 20, 2024

The build workflows didn't run for some reason. But if this breaks the build, I'll just revert it and we can try again. Thank you!

@JesseTG JesseTG merged commit 6126b1d into JesseTG:dev Dec 20, 2024
@abouvier abouvier deleted the cmake-fix branch December 20, 2024 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working build For issues related to the build (not necessarily automated workflows).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants