bindgen icon indicating copy to clipboard operation
bindgen copied to clipboard

Better CMake use of find_clang.cr

Open docelic opened this issue 5 years ago • 0 comments
trafficstars

Currently, CMake calls find_clang.cr 3 times and also parses its stdout. This causes the cmake run time to be longer than needed, and also it makes find_clang.cr unable to print meaningful debug/info messages because its output is parsed directly.

We can improve this in the following way:

  1. Make CMake call find_clang.cr only once
  2. Make find_clang.cr generate all of its content at once and dump it into various files on disk. (Currently it already generates 3 files, but it could generate at least 2 more - one with one for output of --print-clang-libs and one for output of --print-llvm-libs)
  3. CMake should then read in those file
  4. find_clang.cr will then be able to print info/notices to stdout, such as the value of its autodiscovery of BINDGEN_DYNAMIC setting as well as the paths/filenames of all the files it has generated

docelic avatar May 15 '20 22:05 docelic