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 locating the slint-compiler.exe on cmake cross-compiled packages #5922

Merged
merged 1 commit into from
Aug 23, 2024

Conversation

tronical
Copy link
Member

When cross-compiling CMAKE_EXECUTABLE_SUFFIX may not be set to .exe even though the host is Windows, because this variable always refers to the target. This is a missing feature in cmake, so work around it for now. See also https://gitlab.kitware.com/cmake/cmake/-/issues/17553 I made a similar workaround in Corrosion long time ago with commit b8a6b26a0f2d526e0492df9fd88c0495b0b8a64f

The target prop line is duplicated in favor of introducing a variable, that would otherwise be at risk of being visible in the user scope.

When cross-compiling CMAKE_EXECUTABLE_SUFFIX may not be set to .exe even
though the host is Windows, because this variable always refers to the
target. This is a missing feature in cmake, so work around it for now.
See also https://gitlab.kitware.com/cmake/cmake/-/issues/17553 I made a
similar workaround in Corrosion long time ago with commit
b8a6b26a0f2d526e0492df9fd88c0495b0b8a64f

The target prop line is duplicated in favor of introducing a variable,
that would otherwise be at risk of being visible in the user scope.
@tronical tronical requested a review from ogoffart August 23, 2024 15:10
Copy link
Member

@ogoffart ogoffart left a comment

Choose a reason for hiding this comment

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

👍

I wonder if there not a way to pass that from api/cpp/CMakeLists.txt as a @...@ variable based on the slint-compiler target
Something like $<TARGET_FILE:slint-compiler> that we use to install. But I guess that's hard to find out the installed path.

@tronical
Copy link
Member Author

Good idea. I’ll research a little and maybe make a follow-up PR.

@tronical tronical merged commit 13975d9 into master Aug 23, 2024
35 checks passed
@tronical tronical deleted the simon/fix-windows-cross-package-compiler branch August 23, 2024 16:10
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.

2 participants