summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-10-14 21:50:09 +0000
committerChris Bieneman <beanz@apple.com>2015-10-14 21:50:09 +0000
commitf9e0b253ad605a429526b54ffdfcf121deaf082c (patch)
tree2924e45ffc6b8ab7f7765b5bba8dc44da7758598
parente2b528074d9bc97e6800859a46b3e2e8c112e48f (diff)
downloadbcm5719-llvm-f9e0b253ad605a429526b54ffdfcf121deaf082c.tar.gz
bcm5719-llvm-f9e0b253ad605a429526b54ffdfcf121deaf082c.zip
[CMake] Make LLVM_VERSION_* variables user definable
CMake's set command overwrites existing values. Package maintainers may want or need to set the version variables manually, so we need to only set them if they are not already defined. Note I use the "if(NOT DEFINED ...)" syntax deliberately in the last case because empty string is a valid value for the suffx, but not the other variables. llvm-svn: 250333
-rw-r--r--llvm/CMakeLists.txt16
1 files changed, 12 insertions, 4 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index a1713fbb8f9..82e937e7ade 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -26,10 +26,18 @@ else()
set(cmake_3_2_USES_TERMINAL USES_TERMINAL)
endif()
-set(LLVM_VERSION_MAJOR 3)
-set(LLVM_VERSION_MINOR 8)
-set(LLVM_VERSION_PATCH 0)
-set(LLVM_VERSION_SUFFIX svn)
+if(NOT LLVM_VERSION_MAJOR)
+ set(LLVM_VERSION_MAJOR 3)
+endif()
+if(NOT LLVM_VERSION_MINOR)
+ set(LLVM_VERSION_MINOR 8)
+endif()
+if(NOT LLVM_VERSION_PATCH)
+ set(LLVM_VERSION_PATCH 0)
+endif()
+if(NOT DEFINED LLVM_VERSION_SUFFIX)
+ set(LLVM_VERSION_SUFFIX svn)
+endif()
if (POLICY CMP0048)
cmake_policy(SET CMP0048 NEW)
OpenPOWER on IntegriCloud