[llvm] r319723 - [cmake] Modernize some conditionals. NFC
Shoaib Meenai via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 4 17:19:48 PST 2017
Author: smeenai
Date: Mon Dec 4 17:19:48 2017
New Revision: 319723
URL: http://llvm.org/viewvc/llvm-project?rev=319723&view=rev
Log:
[cmake] Modernize some conditionals. NFC
The "x${...}" form was a workaround for CMake versions prior to 3.1,
where the if command would interpret arguments as variables even when
quoted [1]. We can drop the workaround now that our minimum CMake
version is 3.4.
[1] https://cmake.org/cmake/help/v3.1/policy/CMP0054.html
Differential Revision: https://reviews.llvm.org/D40744
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=319723&r1=319722&r2=319723&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/LLVM-Config.cmake (original)
+++ llvm/trunk/cmake/modules/LLVM-Config.cmake Mon Dec 4 17:19:48 2017
@@ -99,9 +99,9 @@ function(explicit_llvm_config executable
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.
More information about the llvm-commits
mailing list