abseil的編譯與使用


項目中集成了abseil。abseil提供了cmake的編譯,但是缺少make install命令。

於是有了下面的的一些命令,用於生成include和lib目錄。

 

function cmake_install() {
  local prefix=$1
  lib_path=$prefix/deploy/lib
  rand_lib=$lib_path/libabsl.a
  mkdir -p $lib_path
  include_path=$prefix/deploy
  mkdir -p $include_path
  #find $deploy -name "*.a" | xargs -i cp {} $lib_path
  (find $deploy -name "*.o" |  xargs ar cru $rand_lib) | (ranlib $rand_lib)
  (find $deploy -mindepth 1 -name "*.h" -print -or -name '*.inc' -print | grep -v deploy |
    sed "s,$prefix/,," | tar --create --files-from -) | (cd $include_path && tar xvfp -)
}
cmake_install $(pwd)

 

參考

增強現實的 abseil 庫(1)

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM