Skip to content

Commit

Permalink
[CMake] Ignore externalizing debuginfo for unit tests
Browse files Browse the repository at this point in the history
If you externalize debug info for unit tests the test runner finds the mach-o inside the dsym bundle and tries to execute it as a test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255056 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Chris Bieneman committed Dec 8, 2015
1 parent 898fa74 commit 5fb71e1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ endmacro(add_llvm_loadable_module name)


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

# Generate objlib
Expand Down Expand Up @@ -660,7 +660,9 @@ macro(add_llvm_executable name)
add_dependencies( ${name} ${LLVM_COMMON_DEPENDS} )
endif( LLVM_COMMON_DEPENDS )

llvm_externalize_debuginfo(${name})
if(NOT ARG_IGNORE_EXTERNALIZE_DEBUGINFO)
llvm_externalize_debuginfo(${name})
endif()
endmacro(add_llvm_executable name)

function(export_executable_symbols target)
Expand Down Expand Up @@ -876,7 +878,7 @@ function(add_unittest test_suite test_name)

set(LLVM_REQUIRES_RTTI OFF)

add_llvm_executable(${test_name} ${ARGN})
add_llvm_executable(${test_name} IGNORE_EXTERNALIZE_DEBUGINFO ${ARGN})
set(outdir ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR})
set_output_directory(${test_name} BINARY_DIR ${outdir} LIBRARY_DIR ${outdir})
target_link_libraries(${test_name}
Expand Down

0 comments on commit 5fb71e1

Please sign in to comment.