[PATCH] D40744: [cmake] Modernize some conditionals. NFC

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 1 12:40:45 PST 2017


smeenai created this revision.
Herald added a subscriber: mgorny.

I'm not sure what the "x..." form was needed for, but it looks super
old-school and unnecessary. Just reference the variable directly and
adjust the comparison strings accordingly.


https://reviews.llvm.org/D40744

Files:
  cmake/modules/LLVM-Config.cmake


Index: cmake/modules/LLVM-Config.cmake
===================================================================
--- cmake/modules/LLVM-Config.cmake
+++ cmake/modules/LLVM-Config.cmake
@@ -99,9 +99,9 @@
 
   llvm_map_components_to_libnames(LIBRARIES ${link_components})
   get_target_property(t ${executable} TYPE)
-  if("x${t}" STREQUAL "xSTATIC_LIBRARY")
+  if(t STREQUAL "STATIC_LIBRARY")
     target_link_libraries(${executable} INTERFACE ${LIBRARIES})
-  elseif("x${t}" STREQUAL "xSHARED_LIBRARY" OR "x${t}" STREQUAL "xMODULE_LIBRARY")
+  elseif(t STREQUAL "SHARED_LIBRARY" OR t STREQUAL "MODULE_LIBRARY")
     target_link_libraries(${executable} PRIVATE ${LIBRARIES})
   else()
     # Use plain form for legacy user.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40744.125195.patch
Type: text/x-patch
Size: 717 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171201/716f9fea/attachment.bin>


More information about the llvm-commits mailing list