[Lldb-commits] [lldb] r177225 - When built with cmake, only call the string functions when the previous commands (utils/GetSourceVersion & utils/GetRepositoryPath successed). Otherwise, they fail when not launched from a repository

Sylvestre Ledru sylvestre at debian.org
Sat Mar 16 10:01:13 PDT 2013


Author: sylvestre
Date: Sat Mar 16 12:01:13 2013
New Revision: 177225

URL: http://llvm.org/viewvc/llvm-project?rev=177225&view=rev
Log:
When built with cmake, only call the string functions when the previous commands (utils/GetSourceVersion & utils/GetRepositoryPath successed). Otherwise, they fail when not launched from a repository

Modified:
    lldb/trunk/source/CMakeLists.txt

Modified: lldb/trunk/source/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/CMakeLists.txt?rev=177225&r1=177224&r2=177225&view=diff
==============================================================================
--- lldb/trunk/source/CMakeLists.txt (original)
+++ lldb/trunk/source/CMakeLists.txt Sat Mar 16 12:01:13 2013
@@ -142,12 +142,16 @@ target_link_libraries(liblldb ${LLDB_SYS
 if ( NOT CMAKE_SYSTEM_NAME MATCHES "Windows" )
   execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetSourceVersion ${LLDB_SOURCE_DIR}
                   OUTPUT_VARIABLE LLDB_REVISION)
-  string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION})
+  if ( LLDB_REVISION )
+    string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REVISION ${LLDB_REVISION})
+  endif()
 
   execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLDB_SOURCE_DIR}
                   OUTPUT_VARIABLE LLDB_REPOSITORY)
-  string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
-  string(REPLACE " " "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
+  if ( LLDB_REPOSITORY )
+    string(REGEX REPLACE "(\r?\n)+$" "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
+    string(REPLACE " " "" LLDB_REPOSITORY ${LLDB_REPOSITORY})
+  endif()
 
   set_property(
     SOURCE lldb.cpp





More information about the lldb-commits mailing list