error: static_assert failed "Error in C++ Standard Library usage.
_EMIT_STL_ERROR(STL1000, "Unexpected compiler version, expected Clang 16.0.0 or newer.");
note: expanded from macro '_EMIT_STL_ERROR' static_assert(false, "Error in C++ Standard Library usage.")
原因:该版本的chromium代码自带的clang版本为14,编译环境要求clang 16+
方法:(有其他的方法还请告知)
安装LLVM 17.0.6
拷贝安装好的LLVM到${SRC}\third_party\llvm-build\LLVM
修改${SRC}\third_party\llvm-build\clang.gni文件
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/toolchain/toolchain.gni")
# 修改为新的clang路径
default_clang_base_path = "//third_party/llvm-build/LLVM"
declare_args() {
# Indicates if the build should use the Chrome-specific plugins for enforcing
# coding guidelines, etc. Only used when compiling with Chrome's Clang, not
# Chrome OS's.
clang_use_chrome_plugins =
is_clang && !is_nacl && current_os != "zos" &&
default_toolchain != "//build/toolchain/cros:target"
clang_base_path = default_clang_base_path
}
error: unable to find plugin 'find-bad-constructs'
原因:不支持自定义编译器
对策:修改args.gn
gn gen --ide=vs2022 --args="clang_use_chrome_plugins=false" out\Default