Skip to content

Commit 55c4956

Browse files
authored
Merge pull request #72548 from gottesmm/pr-9ea3226d4ec4e1094426a535db22d95597f96990
[unittests] Enable debug info when compiling unittests when debug info is enabled.
2 parents c6d21ff + a114a30 commit 55c4956

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)