[llvm] r218542 - Fix misinterpretation of CMake rule found by a CMake warning (related to CMP0054).

Richard Smith richard-llvm at metafoo.co.uk
Fri Sep 26 14:33:05 PDT 2014


Author: rsmith
Date: Fri Sep 26 16:33:05 2014
New Revision: 218542

URL: http://llvm.org/viewvc/llvm-project?rev=218542&view=rev
Log:
Fix misinterpretation of CMake rule found by a CMake warning (related to CMP0054).

lldb sets the variable SHARED_LIBRARY to 1, which breaks this conditional,
because older versions of CMake interpret

  if ("${t}" STREQUAL "SHARED_LIBRARY")

as meaning

  if ("${t}" STREQUAL "1")

in this case. Change the conditional so it does the right thing with both old
and new CMakes.

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=218542&r1=218541&r2=218542&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVM-Config.cmake (original)
+++ llvm/trunk/cmake/modules/LLVM-Config.cmake Fri Sep 26 16:33:05 2014
@@ -40,9 +40,9 @@ function(explicit_llvm_config executable
 
   llvm_map_components_to_libnames(LIBRARIES ${link_components})
   get_target_property(t ${executable} TYPE)
-  if("${t}" STREQUAL "STATIC_LIBRARY")
+  if("x${t}" STREQUAL "xSTATIC_LIBRARY")
     target_link_libraries(${executable} ${cmake_2_8_12_INTERFACE} ${LIBRARIES})
-  elseif("${t}" STREQUAL "SHARED_LIBRARY" OR "${t}" STREQUAL "MODULE_LIBRARY")
+  elseif("x${t}" STREQUAL "xSHARED_LIBRARY" OR "x${t}" STREQUAL "xMODULE_LIBRARY")
     target_link_libraries(${executable} ${cmake_2_8_12_PRIVATE} ${LIBRARIES})
   else()
     # Use plain form for legacy user.





More information about the llvm-commits mailing list