[Lldb-commits] [lldb] r346668 - [CMake] Allow version overrides with -DLLDB_VERSION_MAJOR/MINOR/PATCH/SUFFIX
Stefan Granitz via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 12 08:22:28 PST 2018
Author: stefan.graenitz
Date: Mon Nov 12 08:22:28 2018
New Revision: 346668
URL: http://llvm.org/viewvc/llvm-project?rev=346668&view=rev
Log:
[CMake] Allow version overrides with -DLLDB_VERSION_MAJOR/MINOR/PATCH/SUFFIX
Summary:
This follows the approach in Clang. If no overrides are given, LLDB_VERSION_* is inferred from LLVM_VERSION_*. This mimics the current behaviour (PACKAGE_VERSION itself is generated from LLVM_VERSION_*).
For in-tree builds LLVM_VERSION_* will be defined at this point already. For standalone builds, LLDBConfig.cmake is included after LLDBStandalone.cmake which includes LLVMConfig.cmake.
Reviewers: labath, xiaobai
Subscribers: mgorny, friss, aprantl, lldb-commits
Differential Revision: https://reviews.llvm.org/D54333
Modified:
lldb/trunk/CMakeLists.txt
lldb/trunk/cmake/modules/LLDBConfig.cmake
Modified: lldb/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/CMakeLists.txt?rev=346668&r1=346667&r2=346668&view=diff
==============================================================================
--- lldb/trunk/CMakeLists.txt (original)
+++ lldb/trunk/CMakeLists.txt Mon Nov 12 08:22:28 2018
@@ -56,7 +56,7 @@ if(LLDB_BUILD_FRAMEWORK)
# the framework, and must be defined before building liblldb.
set(PRODUCT_NAME "LLDB")
set(EXECUTABLE_NAME "LLDB")
- set(CURRENT_PROJECT_VERSION "360.99.0")
+ set(CURRENT_PROJECT_VERSION "${LLDB_VERSION}")
set(LLDB_SUITE_TARGET lldb-framework)
set(LLDB_FRAMEWORK_DIR
Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=346668&r1=346667&r2=346668&view=diff
==============================================================================
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Mon Nov 12 08:22:28 2018
@@ -265,9 +265,20 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINA
"`CMakeFiles'. Please delete them.")
endif()
-# Compute the LLDB version from the LLVM version.
-string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" LLDB_VERSION
- ${PACKAGE_VERSION})
+# If LLDB_VERSION_* is specified, use it, if not use LLVM_VERSION_*.
+if(NOT DEFINED LLDB_VERSION_MAJOR)
+ set(LLDB_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
+endif()
+if(NOT DEFINED LLDB_VERSION_MINOR)
+ set(LLDB_VERSION_MINOR ${LLVM_VERSION_MINOR})
+endif()
+if(NOT DEFINED LLDB_VERSION_PATCH)
+ set(LLDB_VERSION_PATCH ${LLVM_VERSION_PATCH})
+endif()
+if(NOT DEFINED LLDB_VERSION_SUFFIX)
+ set(LLDB_VERSION_SUFFIX ${LLVM_VERSION_SUFFIX})
+endif()
+set(LLDB_VERSION "${LLDB_VERSION_MAJOR}.${LLDB_VERSION_MINOR}.${LLDB_VERSION_PATCH}${LLDB_VERSION_SUFFIX}")
message(STATUS "LLDB version: ${LLDB_VERSION}")
include_directories(BEFORE
More information about the lldb-commits
mailing list