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

Fix #9329: [CMake] FindVersion.cmake relied on internal cmake variable #9330

Merged
merged 1 commit into from Jun 10, 2021

Conversation

glx22
Copy link
Contributor

@glx22 glx22 commented Jun 2, 2021

Motivation / Problem

FindVersion.cmake is ran via cmake -P and WIN32 is only set on windows systems.
When cross-compiling for windows from linux, WIN32 is set via the toolchain so configuration works, but cmake -P doesn't have it at build time.

Description

Explicitly tell FindVersion.cmake it's targeting windows.

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 affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

@LordAro
Copy link
Member

LordAro commented Jun 2, 2021

Worth a comment explaining why there's a WINDOWS car ?

@@ -77,6 +77,7 @@ add_custom_target(find_version
-DREV_MAJOR=${PROJECT_VERSION_MAJOR}
-DREV_MINOR=${PROJECT_VERSION_MINOR}
-DREV_BUILD=${PROJECT_VERSION_PATCH}
-DWINDOWS=${WIN32}
Copy link
Member

Choose a reason for hiding this comment

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

Does -DWIN32=${WIN32} work instead, and remove the need for the second change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that works too.

@glx22 glx22 added the backport requested This PR should be backport to current release (RC / stable) label Jun 10, 2021
@glx22 glx22 merged commit 076f3d2 into OpenTTD:master Jun 10, 2021
@glx22 glx22 deleted the fix_9329 branch June 10, 2021 20:14
@TrueBrain TrueBrain removed the backport requested This PR should be backport to current release (RC / stable) label Oct 3, 2021
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

5 participants