且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在cmake中链接所有LLVM库?

更新时间:2022-06-14 23:29:21

llvm_map_components_to_libnames 已过时,因此请避免使用它.将此代码添加到您的CMakeList文件应在配置时获取所有llvm库.

llvm_map_components_to_libnames is outdated, so try avoiding it. Adding this code to your CMakeList file should fetch all the llvm libraries at configure time.

execute_process(COMMAND llvm-config --libs all
                OUTPUT_VARIABLE llvm_libraries)

如果要获取特定组件的库,只需将 all 替换为组件名称.

If you intend to fetch libraries of specific components, just replace all with the component names.