I have a meson project on the path /home/$user/foo/bar/project
. I want to set a variable sys_root in a cross_compile.txt file. I don't want to hard code the path in case my project moves to another directory.
I don't want sys_root = /home/$user/foo/bar/project/prefix. I want i
sys_root = project-dir/foo/bar/prefix
What is the variable for the current directory with the cross_compile.txt in case it is in the same directory with the meson.build file?
CodePudding user response:
The closest thing that currently exists is the [constants]
section of the machine files, you can write something like:
[constants]
root_dir = "/home/$user"
and
[properties]
sys_root = root_dir "/project_dir/..."
And layer them together with meson setup builddir --cross-file contants.ini --cross-file main.ini