flutter-elinux
flutter-elinux copied to clipboard
fix: Fixes for Cross-Compilation Issues
This pull request includes two key modifications to address potential issues in the cross-compilation process:
1. Configuration Updates in CMakeLists.txt
Introducing necessary configurations in CMakeLists.txt
to ensure the correct discovery and linking of package directories during cross-compilation. The changes include:
-
Finding and Linking Required Packages:
- Fontconfig
- X11 with xkbcommon
- OpenGL with EGL
-
Utilizing pkg-config to locate Wayland libraries:
- wayland-egl
- wayland-client
- wayland-cursor
- Linking Dependencies: These dependencies are linked to the flutter target.
- Including Necessary Directories: The required directories for these dependencies are included.
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:
-
Issue: The current implementation assumed specific commands for invoking
clang
andclang++
. However, different operating systems might use different commands. For instance, on NixOS, the commands areaarch64-unknown-linux-gnu-clang
andaarch64-unknown-linux-gnu-clang++
. - Solution: The commit respects the original environment variable settings, allowing users to specify the binary names provided by their distribution. This flexibility improves support for various operating systems and compilation environments.
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.