Skip to content

Commit a2385fb

Browse files
committed
[unittests] Enable debug info when compiling unittests when debug info is enabled.
I noticed this while I was debugging a failure in unittest. (cherry picked from commit a114a30)
1 parent b12d082 commit a2385fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/modules/AddSwiftUnittests.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ function(add_swift_unittest test_dirname)
111111
endif()
112112
endif()
113113

114+
is_build_type_with_debuginfo("${CMAKE_BUILD_TYPE}" HAS_DEBUG_INFO)
115+
target_compile_options("${test_dirname}" PRIVATE $<$<BOOL:${HAS_DEBUG_INFO}>:-g>)
116+
114117
file(RELATIVE_PATH relative_lib_path "${CMAKE_CURRENT_BINARY_DIR}" "${SWIFT_LIBRARY_OUTPUT_INTDIR}")
115118

116119
if(SWIFT_HOST_VARIANT_SDK IN_LIST SWIFT_DARWIN_PLATFORMS)

0 commit comments

Comments
 (0)