Meson build gives "clang-14: error: unknown argument" for opt options when passed through meson.build but clang options are accepted

Viewed 24

I need to use meson build system, for a project, I am forced to give CXXFLAGS via, meson.build itself. According to offical meson documentation To add compiler options via add_project_arguments meson I need to give clang and opt options in the meson.build itself. This is how I do it in meson.build, I am supposed to use clang-14. The problem is as per the error log file, It accepts the clang options ( Those not prefixed by -mllvm ) like -O3 or -ftlo, because I see no error log for these clang options, but the options with ( -mllvm -some_opt_option ) gives me error clang-14: error: unknown argument: 'some_opt_option' how do I get past this error, and make meson to accept these opt options and not just clang options.

if cc.get_id() == 'clang'
  # Thread safety annotation
  add_project_arguments('-O3', language : 'cpp')
0 Answers
Related