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 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}

This comment has been minimized.

@PeterN

PeterN Jun 3, 2021
Member

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

This comment has been minimized.

@glx22

glx22 Jun 3, 2021
Author Contributor

Yes, that works too.

@glx22 glx22 merged commit 076f3d2 into OpenTTD:master Jun 10, 2021
13 checks passed
13 checks passed
@github-actions
Check for preview label
Details
@github-actions
Emscripten
Details
@github-actions
Commit checker
Details
@github-actions
Linux (clang, clang++, libsdl2-dev)
Details
@github-actions
Linux (gcc, g++, libsdl2-dev)
Details
@github-actions
Linux (gcc, g++, libsdl1.2-dev)
Details
@github-actions
Linux (gcc, g++, -DOPTION_DEDICATED=ON)
Details
@github-actions
Mac OS (x64, x86_64)
Details
@github-actions
Windows (windows-latest, x86)
Details
@github-actions
Windows (windows-latest, x64)
Details
@github-actions
Windows (windows-2016, x86)
Details
@github-actions
Windows (windows-2016, x64)
Details
@github-actions
Check Annotations
Details
@glx22 glx22 deleted the glx22:fix_9329 branch Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants