[llvm] r334082 - [cmake] fix a typo in llvm_config macro

Pavel Labath via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 03:07:08 PDT 2018


Author: labath
Date: Wed Jun  6 03:07:08 2018
New Revision: 334082

URL: http://llvm.org/viewvc/llvm-project?rev=334082&view=rev
Log:
[cmake] fix a typo in llvm_config macro

Summary:
The macro parses out the USE_SHARED option out of the argument list, but
then ignores it and accesses the variable with the same name instead. It
seems the intention here was to check the argument value.

Technically, this is NFC, because the only in-tree usage
(add_llvm_executable) of USE_SHARED sets both the variable and the
argument when calling llvm_config, but it makes the usage of this macro
for out-of-tree users more sensible.

Reviewers: mgorny, beanz

Reviewed By: mgorny

Subscribers: foutrelis, llvm-commits

Differential Revision: https://reviews.llvm.org/D44420

Modified:
    llvm/trunk/cmake/modules/LLVM-Config.cmake

Modified: llvm/trunk/cmake/modules/LLVM-Config.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/LLVM-Config.cmake?rev=334082&r1=334081&r2=334082&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVM-Config.cmake (original)
+++ llvm/trunk/cmake/modules/LLVM-Config.cmake Wed Jun  6 03:07:08 2018
@@ -68,7 +68,7 @@ macro(llvm_config executable)
   cmake_parse_arguments(ARG "USE_SHARED" "" "" ${ARGN})
   set(link_components ${ARG_UNPARSED_ARGUMENTS})
 
-  if(USE_SHARED)
+  if(ARG_USE_SHARED)
     # If USE_SHARED is specified, then we link against libLLVM,
     # but also against the component libraries below. This is
     # done in case libLLVM does not contain all of the components




More information about the llvm-commits mailing list