Issue with meson.get_compiler('cpp') after upgrade to macOS Big Sur

148 views
Skip to first unread message

Michael Odden

unread,
Jan 16, 2021, 7:30:14 AM1/16/21
to The Meson Build System
Hello,

I recently updated to macOS Big Sur (11.1), and now I get the following error related to calling "meson.get_compiler('cpp')":

'ERROR: Tried to access compiler for language "cpp", not specified for host machine'. 

This is with Meson v0.56.2.

Anyone with any thoughts to how I may proceed?

If I simply modify build.meson to bypass this check everything compiles as expected w/ Apple clang version 12.0.0 (clang-1200.0.32.28).


Best regards,
Michael Odden

Michael Odden

unread,
Jan 20, 2021, 3:57:11 PM1/20/21
to The Meson Build System
Solved.

The reason for this (and apologies for not providing examples here) was that I used meson.get_compiler() as part of defining the initial project():

project('prosit', 'cpp',
  version : '0.1.0',
  default_options : [
  'warning_level=3',
  meson.get_compiler('cpp').get_id() == 'msvc' ? 'cpp_std=vc++latest' : 'cpp_std=c++17'])

- thus the internal list of compilers wasn't already constructed. It seems this "worked" earlier as I only ran "meson --reconfigure" on my targets after I introduced this.

My current solution is to provide it through executable()'s 'override_options', although I would prefer to be able to set this once globally. I tried naively to find a way to access and modify the data set up by project() but no luck so far.


Best regards,
Michael Odden

Reply all
Reply to author
Forward
0 new messages