How to build clang/examples/PrintFunctionNames?

前端 未结 4 1078
失恋的感觉
失恋的感觉 2021-02-08 00:33

I need some simple example to start using clang. I downloaded llvm and clang and built:

mkdir llvm-build
cd llvm-build
../llvm/configure
make

I

4条回答
  •  鱼传尺愫
    2021-02-08 01:06

    I followed the instructions at http://clang.llvm.org/get_started.html with two exceptions:

    1. My build dir is inside the source dir (i.e. cd llvm ; mkdir build), but I don't think it's relevant.
    2. I issued cmake as so :

      cd build

      cmake -DLLVM_BUILD_EXAMPLES=1 -DCLANG_BUILD_EXAMPLES=1 ..

    After that (and compiling of course (make -j8)) I could find the examples in the build dir :

    find -iname '*printfunctionname*'
    ./lib/PrintFunctionNames.so
    ...
    

提交回复
热议问题