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

llvm-svn: 177225
This commit is contained in:
Sylvestre Ledru 2013-03-16 17:01:13 +00:00
parent ca11d2c7ff
commit 6d88a690e6
1 changed files with 7 additions and 3 deletions

View File

@ -142,12 +142,16 @@ target_link_libraries(liblldb ${LLDB_SYSTEM_LIBS})
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