weixin_39822993 2020-11-30 11:25
浏览 0

Should be option to exit 0

Originally reported on Google Code with ID 87


iwyu always exits non-zero. This prevents me from using it as the compiler in cmake,
sense the can compile anything checks fail and then it aborts configuring. This check
should pass, but it doesn't.

$ cmake ../ -DCMAKE_CXX_COMPILER=/usr/local/bin/include-what-you-use -DCMAKE_C_COMPILER=/usr/local/bin/clang
-DCMAKE_CXX_FLAGS="-Xiwyu --mapping_file=${IWYUSRCPATH}/gcc.symbols.imp"


 Check for working CXX compiler: /usr/local/bin/include-what-you-use
-- Check for working CXX compiler: /usr/local/bin/include-what-you-use -- broken
CMake Error at /opt/local/share/cmake-2.8/Modules/CMakeTestCXXCompiler.cmake:45 (MESSAGE):
  The C++ compiler "/usr/local/bin/include-what-you-use" is not able to
  compile a simple test program.

  It fails with the following output:

   Change Dir: /Users/matt/src/cods/build_iwyu/CMakeFiles/CMakeTmp



  Run Build Command:/usr/bin/make "cmTryCompileExec1986701136/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec1986701136.dir/build.make
  CMakeFiles/cmTryCompileExec1986701136.dir/build

  /opt/local/bin/cmake -E cmake_progress_report
  /Users/matt/src/cods/build_iwyu/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building CXX object
  CMakeFiles/cmTryCompileExec1986701136.dir/testCXXCompiler.cxx.o

  /usr/local/bin/include-what-you-use -Xiwyu
  --mapping_file=/Users/matt/src/llvm/tools/clang/tools/include-what-you-use/gcc.symbols.imp
  -o CMakeFiles/cmTryCompileExec1986701136.dir/testCXXCompiler.cxx.o -c
  /Users/matt/src/cods/build_iwyu/CMakeFiles/CMakeTmp/testCXXCompiler.cxx



  (/Users/matt/src/cods/build_iwyu/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
  has correct #includes/fwd-decls)

  make[1]: ***
  [CMakeFiles/cmTryCompileExec1986701136.dir/testCXXCompiler.cxx.o] Error 1

  make: *** [cmTryCompileExec1986701136/fast] Error 2


Reported by whatmannerofburgeristhis on 2012-12-27 21:20:05

该提问来源于开源项目:include-what-you-use/include-what-you-use

  • 写回答

12条回答 默认 最新

  • weixin_39822993 2020-11-30 11:25
    关注
    
    I don't completely understand why you need to use IWYU as your CMake C++ compiler, can
    you explain why this is needed?
    

    Reported by kim.grasman on 2012-12-27 22:16:35

    评论

报告相同问题?