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

Workaround CMake/Xcode duplicate file name issue #11186

Merged
merged 1 commit into from
Sep 2, 2023

Conversation

Bouke
Copy link
Contributor

@Bouke Bouke commented Aug 11, 2023

Motivation / Problem

9b56505 separated the code into a library and executable. This triggers a bug in CMake's Xcode project file generation. The result is a failing build. The suggested workaround is to rename one of the offending files, which is what this PR does. With this change Xcode will happily build the project.

Description

Limitations

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@PeterN
Copy link
Member

PeterN commented Aug 11, 2023

Can you please fix your commit message match our style rules.

@Bouke
Copy link
Contributor Author

Bouke commented Aug 11, 2023

Can you please fix your commit message match our style rules.

Done!

Having a library with files with the same name isn't supported in CMake's Xcode project file generation: https://gitlab.kitware.com/cmake/cmake/-/issues/20501. One of the files is renamed to work around this bug.
@Bouke
Copy link
Contributor Author

Bouke commented Aug 14, 2023

I've resolved the merge conflict.

@TrueBrain
Copy link
Member

TrueBrain commented Aug 14, 2023

It is MSVC 20-old all over again. Stupid stuff :P

(in MSVC, all names used to be unique, no matter what folder they were in; we had so many issues with that in the past .. I was hoping we were finally done with it :P But now MacOS took the stage! :D )

@Bouke
Copy link
Contributor Author

Bouke commented Aug 14, 2023

Not sure if it really is Xcode or just CMake generating invalid build instructions (from what I gather in the linked bug description, it seems the latter). All in all, no not ideal.

@PeterN
Copy link
Member

PeterN commented Aug 14, 2023

I think this should be deferred, pending a PR that introduces a CI check to ensure that source filenames are unique.

@Bouke
Copy link
Contributor Author

Bouke commented Aug 17, 2023

I think this should be deferred, pending a PR that introduces a CI check to ensure that source filenames are unique.

A PR that introduces a check for duplicates will fail because of this issue. So let's first start with this, so Xcode project file generation is at least fixed. The duplicate checker can be merged later. If there's a duplicate introduced in the mean time (small chance), we'll resolve it then.

@glx22 glx22 merged commit 7e54418 into OpenTTD:master Sep 2, 2023
20 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.

None yet

4 participants