Closed Taha-Firoz closed 2 years ago
This should close #128
And also, please add Developer Certificate of Origin (DCO).
I followed the CONTRIBUTING guide but I don't know how to add a DCO, it says I should just add this to my commit message Signed-off-by: Taha Firoz mtahafiroz@gmail.com
🤷♂️
I disagree with this change. In https://cmake.org/cmake/help/latest/variable/CMAKE_SYSROOT.html , it says that this variable can only be set with toolchain file (or, be passed in commandline arguments).
What I recommend you to try, is to put this line: set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
before project
. In this way cmake probably won't try to find the make
tool in your sysroot. Please tell me if this works.
Okay this works, I'm also adding an update in the wiki because now specifying compiler triple is also required now.
I disagree with this change.
Of course I disagree with it too but I don't know too much about cmake and I just needed my code to compile which is why I made that work around. Your proposed solution fixes it properly, I also think maybe we can add a new parameter to flutter-elinux as an optional string to pass any arbitrary flags to cmake.
Is the PR ready to be reviewed/merged or still a draft?
Ready for review
Thanks a lot.
You forgot to add the wiki entries
Updated.
Cross compile from x86 to arm is broken atleast for me, every since
CMAKE_SYSROOT
was passed directly thetry_compile
uses an arm compiler instead of a cross compiler which makes it fail everytime.I have tried creating new projects and this is a reproducible error, compile any new flutter-elinux project with:
You will get this error:
This is because when
CMAKE_SYSROOT
is set before theproject
statement cmakestry_compile
uses make from the arm64 sysroot which won't run on x86. My work around is simple just so I don't have to revert everything done in #105 set a temporary variable asCMAKE_SYSROOT
, unsetCMAKE_SYSROOT
, lettry_compile
succeed then setCMAKE_SYSROOT
to temp variable and setCMAKE_FIND_ROOT_PATH
.This is only a work around but it finally works, also you need to update the documentation that specifying
--target-compiler-triple=aarch64-linux-gnu
for regular x86-arm is required now, the previous versions would add this flag automatically but this current version no longer adds it automatically and thus builds fail.