[llvm] r250841 - [CMake] All the checks for if LLVM_VERSION_* variables are set need to be if(DEFINED ...)

Chris Bieneman via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 20 11:16:38 PDT 2015


Author: cbieneman
Date: Tue Oct 20 13:16:37 2015
New Revision: 250841

URL: http://llvm.org/viewvc/llvm-project?rev=250841&view=rev
Log:
[CMake] All the checks for if LLVM_VERSION_* variables are set need to be if(DEFINED ...)

This is because if you set one of the variables to 0, if(NOT ...) is true, which isn't what you actually want. Should have thought that through better the first time.

Modified:
    llvm/trunk/CMakeLists.txt

Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=250841&r1=250840&r2=250841&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Tue Oct 20 13:16:37 2015
@@ -26,13 +26,13 @@ else()
   set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
 endif()
 
-if(NOT LLVM_VERSION_MAJOR)
+if(NOT DEFINED LLVM_VERSION_MAJOR)
   set(LLVM_VERSION_MAJOR 3)
 endif()
-if(NOT LLVM_VERSION_MINOR)
+if(NOT DEFINED LLVM_VERSION_MINOR)
   set(LLVM_VERSION_MINOR 8)
 endif()
-if(NOT LLVM_VERSION_PATCH)
+if(NOT DEFINED LLVM_VERSION_PATCH)
   set(LLVM_VERSION_PATCH 0)
 endif()
 if(NOT DEFINED LLVM_VERSION_SUFFIX)




More information about the llvm-commits mailing list