Skip to content

Commit

Permalink
Add -g flag to generate debuginfo on unix platforms (dotnet/corefx#24979
Browse files Browse the repository at this point in the history
)

The windows build already includes /Zi /Zl as part of commit 920fd2f
(PR dotnet/corefx#7840). It looks like it was simply missed on Unix.

This change also makes the native debug information closer to what
CoreCLR does on all platforms. See
dotnet/coreclr#3445 for more information.

This is also needed for the end-to-end debuginfo generation as part of
source-build. See dotnet/source-build#267

Commit migrated from dotnet/corefx@efe7652
  • Loading branch information
omajid authored and jkotas committed Nov 1, 2017
1 parent 06be01b commit b9b52fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libraries/Native/Unix/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ add_compile_options(-fPIC)
add_compile_options(-I${CMAKE_CURRENT_SOURCE_DIR}/Common)
add_compile_options(-I${CMAKE_CURRENT_BINARY_DIR}/Common)
add_compile_options(-Wno-c99-extensions)
add_compile_options(-g)

if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.5)
add_compile_options(-Wno-unreachable-code)
Expand Down Expand Up @@ -60,7 +61,7 @@ endif ()

string(TOUPPER ${CMAKE_BUILD_TYPE} UPPERCASE_CMAKE_BUILD_TYPE)
if (UPPERCASE_CMAKE_BUILD_TYPE STREQUAL DEBUG)
add_compile_options(-g -O0)
add_compile_options(-O0)
add_definitions(-DDEBUG)

# obtain settings from running coreclr\enablesanitizers.sh
Expand Down

0 comments on commit b9b52fb

Please sign in to comment.