[llvm-commits] PATCH: (cmake) Fix tool-less build

NAKAMURA Takumi geek4civic at gmail.com
Mon Dec 24 14:46:02 PST 2012


Oscar, I have committed in r171046, with message tweaks, thank you.

...Takumi

2012/12/23 Óscar Fuentes <ofv at wanadoo.es>:
>
> Ping.
>
> Óscar Fuentes <ofv at wanadoo.es> writes:
>
>> With a LLVM checkout, without other projects in LLVM's source tree
>> (Clang...), configure with
>>
>>
>> mkdir foo
>> cd foo
>> cmake -DLLVM_BUILD_TOOLS=OFF ../llvm
>>
>> or, if Clang is under tools/ subdirectory:
>>
>> cmake -DLLVM_BUILD_TOOLS=OFF -DLLVM_EXTERNAL_CLANG_BUILD=OFF ../llvm
>>
>> (BTW, shouldn't it be LLVM_BUILD_EXTERNAL_CLANG, for consistency with
>> LLVM_BUILD_(TOOLS|EXAMPLES|etc) ?)
>>
>> This fails with
>>
>> CMake Error at cmake/modules/AddLLVM.cmake:280 (add_dependencies):
>>   add_dependencies called with incorrect number of arguments
>> Call Stack (most recent call first):
>>   CMakeLists.txt:441 (add_lit_target)
>>
>>
>> Apparently, ARG_DEPENDS is empty if there are no tools nor clang in the
>> build. The patch below fixes the problem. A possible problem happens
>> when the user builds with the above mentioned options, then builds the
>> tools or clang with its own `make' command (because the options just
>> remove those targets from the default build.)
>>
>>
>> diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
>> index 43ee9a0..7e1f704 100755
>> --- a/cmake/modules/AddLLVM.cmake
>> +++ b/cmake/modules/AddLLVM.cmake
>> @@ -277,7 +277,9 @@ function(add_lit_target target comment)
>>      COMMAND ${LIT_COMMAND} ${ARG_DEFAULT_ARGS}
>>      COMMENT "${comment}"
>>      )
>> -  add_dependencies(${target} ${ARG_DEPENDS})
>> +  if( ARG_DEPENDS )
>> +    add_dependencies(${target} ${ARG_DEPENDS})
>> +  endif()
>>  endfunction()
>>
>>  # A function to add a set of lit test suites to be driven through 'check-*' targets.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list