woboq / moc-ng

A reimplementation of Qt's moc using libclang. Contains both a drop-in remplacement, and a plugin for the clang compiler.
https://woboq.com/blog/moc-with-clang.html
GNU General Public License v3.0
204 stars 24 forks source link

Infinite loop in cmake when specifying compiler #2

Closed nordlow closed 9 years ago

nordlow commented 11 years ago

When I add the flag

-DCMAKE_CXX_COMPILER=/opt/llvm/bin/clang++

as argument to the cmake call I get an infinite recursion: -- LLVM CXX flags: -I/usr/lib/llvm-3.2/include -DNDEBUG -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -g -O2 -fomit-frame-pointer -fvisibility-inlines-hidden -fno-exceptions -fno-rtti -fPIC -Woverloaded-virtual -Wcast-qual -- LLVM LD flags: -L/usr/lib/llvm-3.2/lib -lpthread -lffi -ldl -lm -- LLVM core libs: -lLLVMAsmParser -lLLVMInstrumentation -lLLVMLinker -lLLVMArchive -lLLVMBitReader -lLLVMDebugInfo -lLLVMJIT -lLLVMipo -lLLVMVectorize -lLLVMBitWriter -lLLVMTableGen -lLLVMHexagonCodeGen -lLLVMHexagonDesc -lLLVMHexagonInfo -lLLVMHexagonAsmPrinter -lLLVMNVPTXCodeGen -lLLVMNVPTXDesc -lLLVMNVPTXInfo -lLLVMNVPTXAsmPrinter -lLLVMMBlazeAsmParser -lLLVMMBlazeDisassembler -lLLVMMBlazeCodeGen -lLLVMMBlazeDesc -lLLVMMBlazeInfo -lLLVMMBlazeAsmPrinter -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMMSP430CodeGen -lLLVMMSP430Desc -lLLVMMSP430Info -lLLVMMSP430AsmPrinter -lLLVMXCoreCodeGen -lLLVMXCoreDesc -lLLVMXCoreInfo -lLLVMCellSPUCodeGen -lLLVMCellSPUDesc -lLLVMCellSPUInfo -lLLVMMipsDisassembler -lLLVMMipsAsmParser -lLLVMMipsCodeGen -lLLVMMipsDesc -lLLVMMipsInfo -lLLVMMipsAsmPrinter -lLLVMARMDisassembler -lLLVMARMAsmParser -lLLVMARMCodeGen -lLLVMARMDesc -lLLVMARMInfo -lLLVMARMAsmPrinter -lLLVMPowerPCCodeGen -lLLVMPowerPCDesc -lLLVMPowerPCInfo -lLLVMPowerPCAsmPrinter -lLLVMSparcCodeGen -lLLVMSparcDesc -lLLVMSparcInfo -lLLVMX86AsmParser -lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMR600CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMR600Desc -lLLVMR600AsmPrinter -lLLVMR600Info -lLLVMMCDisassembler -lLLVMMCParser -lLLVMInterpreter -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMMCJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -- LLVM JIT libs: -lLLVMX86AsmParser -lLLVMX86Disassembler -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter -lLLVMX86Utils -lLLVMJIT -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMCodeGen -lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMObject -lLLVMCore -lLLVMSupport -- LLVM JIT objs: -- Found LLVM: /usr/lib/llvm-3.2/include -- Clang libs: /usr/lib/libclangFrontend.a/usr/lib/libclangDriver.a/usr/lib/libclangSema.a/usr/lib/libclangAnalysis.a/usr/lib/libclangAST.a/usr/lib/libclangParse.a/usr/lib/libclangLex.a/usr/lib/libclangBasic.a/usr/lib/libclangEdit.a/usr/lib/libclangSerialization.a/usr/lib/libclangTooling.a/usr/lib/libclangSema.a -- Found Clang: /usr/lib/llvm-3.2/include -- Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_CXX_COMPILER= /usr/bin/clang++

-- LLVM CXX flags: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- LLVM LD flags: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- LLVM core libs: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- LLVM JIT libs: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- LLVM JIT objs: -- Found LLVM: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found CMake Warning (dev) at src/CMakeLists.txt:26 (link_directories): This command specifies the relative path

sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the source dir. Run "cmake --help-policy CMP0015" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it.

-- Clang libs: /usr/lib/libclangFrontend.a/usr/lib/libclangDriver.a/usr/lib/libclangSema.a/usr/lib/libclangAnalysis.a/usr/lib/libclangAST.a/usr/lib/libclangParse.a/usr/lib/libclangLex.a/usr/lib/libclangBasic.a/usr/lib/libclangEdit.a/usr/lib/libclangSerialization.a/usr/lib/libclangTooling.a/usr/lib/libclangSema.a -- Found Clang: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- Configuring done You have changed variables that require your cache to be deleted. Configure will be re-run and you may have to reset some variables. The following variables have changed: CMAKE_CXX_COMPILER= /usr/bin/clang++

-- LLVM CXX flags: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- LLVM LD flags: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- LLVM core libs: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- LLVM JIT libs: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found -- LLVM JIT objs: -- Found LLVM: sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found CMake Warning (dev) at src/CMakeLists.txt:26 (link_directories): This command specifies the relative path

sh: 1: LLVM_CONFIG_EXECUTABLE-NOTFOUND: not found

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the source dir. Run "cmake --help-policy CMP0015" for policy details. Use the cmake_policy command to set the policy and suppress this warning. ...

ogoffart commented 11 years ago

I don't really know what's causing this. You can try to make a clean build. Call git clean -xdf (warning, this removes all the files not in the git repository) and try cmake again.

woboq commented 11 years ago

@nordlow Did that fix your issue?

nordlow commented 11 years ago

Yep it did. Thx!