[CMake] All the checks for if LLVM_VERSION_* variables are set need to be if(DEFINED...
authorChris Bieneman <beanz@apple.com>
Tue, 20 Oct 2015 18:16:37 +0000 (18:16 +0000)
committerChris Bieneman <beanz@apple.com>
Tue, 20 Oct 2015 18:16:37 +0000 (18:16 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250841 91177308-0d34-0410-b5e6-96231b3b80d8

CMakeLists.txt

index 82e937e7adecec4befe7ed277c4f7f8c1131606f..bbfd68d5590ce8095d5226b9140894d61443f6ca 100644 (file)
@@ -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)