Skip to content

Commit

Permalink
[CMake] Disable rpath for UnitTests
Browse files Browse the repository at this point in the history
This was broken since rL285714.

Differential Revision: https://reviews.llvm.org/D26246

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285881 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Jonas Hahnfeld authored and Jonas Hahnfeld committed Nov 3, 2016
1 parent ba1655d commit 8186cc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 5 additions & 3 deletions cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ endmacro(add_llvm_loadable_module name)


macro(add_llvm_executable name)
cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO" "" "" ${ARGN})
cmake_parse_arguments(ARG "DISABLE_LLVM_LINK_LLVM_DYLIB;IGNORE_EXTERNALIZE_DEBUGINFO;NO_INSTALL_RPATH" "" "" ${ARGN})
llvm_process_sources( ALL_FILES ${ARG_UNPARSED_ARGUMENTS} )

# Generate objlib
Expand Down Expand Up @@ -662,7 +662,9 @@ macro(add_llvm_executable name)
add_executable(${name} ${ALL_FILES})
endif()

llvm_setup_rpath(${name})
if(NOT ARG_NO_INSTALL_RPATH)
llvm_setup_rpath(${name})
endif()

if(DEFINED windows_resource_file)
set_windows_version_resource_properties(${name} ${windows_resource_file})
Expand Down Expand Up @@ -990,7 +992,7 @@ function(add_unittest test_suite test_name)
set(LLVM_REQUIRES_RTTI OFF)

list(APPEND LLVM_LINK_COMPONENTS Support) # gtest needs it for raw_ostream
add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO ${ARGN})
add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO NO_INSTALL_RPATH ${ARGN})
set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
# libpthreads overrides some standard library symbols, so main
Expand Down
4 changes: 0 additions & 4 deletions unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
add_custom_target(UnitTests)
set_target_properties(UnitTests PROPERTIES FOLDER "Tests")

# People tend to run the tests _before_ installing, so we don't want the install
# rpath here.
set(CMAKE_BUILD_WITH_INSTALL_RPATH OFF)

function(add_llvm_unittest test_dirname)
add_unittest(UnitTests ${test_dirname} ${ARGN})
endfunction()
Expand Down

0 comments on commit 8186cc4

Please sign in to comment.