Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document and test env vars a bit better #6827

Merged
merged 1 commit into from Apr 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/markdown/howtox.md
Expand Up @@ -12,12 +12,12 @@ When first running Meson, set it in an environment variable.
$ CC=mycc meson <options>
```

Note that environment variables like `CC` only works in native builds.
The `CC` refers to the compiler for the host platform, that is the
compiler used to compile programs that run on the machine we will
eventually install the project on. The compiler used to build things
that run on the machine we do the building can be specified with
`CC_FOR_BUILD`. You can use it in cross builds.
Note that environment variables like `CC` only refer to the host
platform in cross builds. That is, `CC` refers to the compiler used to
compile programs that run on the machine we will eventually install the
project on. The compiler used to build things that run on the machine we
do the building can be specified with `CC_FOR_BUILD`. You can use it in
cross builds.

Note that environment variables are never the idiomatic way to do
anything with Meson, however. It is better to use the native and cross
Expand Down
6 changes: 2 additions & 4 deletions unittests/linuxliketests.py
Expand Up @@ -1545,12 +1545,10 @@ def test_identity_cross_env(self):
testdir = os.path.join(self.unit_test_dir, '60 identity cross')
env = {
'CC_FOR_BUILD': '"' + os.path.join(testdir, 'build_wrapper.py') + '"',
'CC': '"' + os.path.join(testdir, 'host_wrapper.py') + '"',
}
crossfile = tempfile.NamedTemporaryFile(mode='w')
crossfile.write(textwrap.dedent('''\
[binaries]
c = ['{}']
'''.format(os.path.join(testdir, 'host_wrapper.py'))))
crossfile.write('')
crossfile.flush()
self.meson_cross_files = [crossfile.name]
# TODO should someday be explicit about build platform only here
Expand Down