Conversation
…ing diverse compiler invocation commands This commit addresses the issue where certain operating systems (e.g., NixOS) were unable to complete cross-platform compilation. The current implementation assumes that all clang and clang++ invocations are done using specific commands. However, in reality, the invocation of these compilers can vary. For example, on NixOS, the compiler commands are actually: `aarch64-unknown-linux-gnu-clang` and `aarch64-unknown-linux-gnu-clang++`. To resolve this, we should respect the original environment variable settings and allow users to determine the binary names provided by their distribution. This adjustment improves our support for different operating systems and compilation environments, enhancing the cross-platform compatibility of the project.
This commit added necessary configurations to `CMakeLists.txt` to ensure the correct discovery of package directories during cross-compilation. This includes: - Finding and linking required packages: Fontconfig, X11 with xkbcommon, and OpenGL with EGL. - Utilizing pkg-config to locate Wayland libraries: wayland-egl, wayland-client, and wayland-cursor. - Linking these dependencies to the flutter target. - Including the necessary directories for these dependencies. These changes address the issue where the build system could not correctly locate package directories during cross-compilation, thereby ensuring a successful build process.
|
Thank you for sending this PR.
X11, Wayland, and DRM are independent of each other, and aside from common dependency libraries, they are not required for building an application. For example, in the case of X11, the Wayland libraries are unnecessary. If you want to proceed with this change, you will need to implement code that checks for only the necessary components depending on the type of backend.
This looks good to me. |
|
It seems we need to find a way for CMake to know which dependencies it requires. This is a bit complex to me, so please give me some time to think about this issue. |
|
I suppose |
|
Thank you, I've rebased and re-opened the cc part of the change here: flutter-elinux#4 The cmake change probably needs to check required dependencies as @HidenoriMatsubayashi said, so I left it out -- if you still have any attachment to this then feel free to re-open that part against https://github.com/flutter-elinux/flutter-elinux once that's done. |
This pull request includes two key modifications to address potential issues in the cross-compilation process:
1. Configuration Updates in
CMakeLists.txtIntroducing necessary configurations in
CMakeLists.txtto ensure the correct discovery and linking of package directories during cross-compilation. The changes include:Problem Addressed:
Previously, the build system struggled to correctly locate package directories during cross-compilation, leading to build failures. These changes ensure that the necessary packages and libraries are correctly found and linked, thereby facilitating a successful build process.
2. Fix for Diverse Compiler Invocation Commands
Resolving issues related to cross-platform compilation on certain operating systems, such as NixOS, by supporting diverse compiler invocation commands.
Details:
clangandclang++. However, different operating systems might use different commands. For instance, on NixOS, the commands areaarch64-unknown-linux-gnu-clangandaarch64-unknown-linux-gnu-clang++.Problem Addressed:
Certain operating systems were unable to complete cross-platform compilation due to hardcoded compiler invocation commands. By allowing customizable compiler commands, this fix enhances the project's cross-platform compatibility.
Potentially related to #159, since an incorrect compiler could trigger the same error.