Fork me on github

【Linux】cmake编译指定 gcc/g++

 

1. 编译前设置环境变量

export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
cmake /path/to/your/project
make

2. 在cmake文件中设置,打开文件CMakeLists.txt

set(CMAKE_C_COMPILER "afl-gcc")
set(CMAKE_CXX_COMPILER "afl-g++")
//退出文件 cmake
/path/to/your/project make

 

posted @ 2020-11-09 13:08  未配妥剑,已入江湖  阅读(1128)  评论(0编辑  收藏  举报