CFLAGS for cross-compilation

448 views
Skip to first unread message

R. Diez

unread,
Jun 13, 2021, 3:43:28 PM6/13/21
to The Meson Build System
Hi all:

I have  seen a number of GitHub issues regarding compiler flags when cross-compiling, so I gather that this aspect is not quite right yet in Meson. But all I need at the moment is some guidance and maybe a reasonable workaround. Please keep in mind that I am new to Mason.

I want to use the following cross file:


However, I need to have fine control of the compilation flags. That is, I need my own c_args . But the rest of the file is fine. If future versions have other changes, I would like to use the updated file version, except for c_args .

I would normally resort to CFLAGS and co, but that's not available when cross-compiling.

If I have understood correctly, there is no way to override cross-compilation compiler flags from the command line. Some people are allegedly using a script that generates such a cross file for Meson.

What's the best way to tackle this problem?

Is there an existing tool that can read that cross.txt file and replace just the c_args with some command-line arguments passed with the standard syntax from an existing makefile?

Or would it be better to submit a patch to that project in order to break-up all such cross.txt files, so that it's easier to override just the compiler settings?

Thanks in advance,
  rdiez

Reply all
Reply to author
Forward
0 new messages