cmake: Generate correct inline source listings in asm output

Manually provide a source path prefix to objdump
This commit is contained in:
Yuri D'Elia 2022-10-01 23:17:52 +02:00
parent a8e85bd146
commit 4412881439
1 changed files with 1 additions and 1 deletions

View File

@ -321,7 +321,7 @@ function(add_base_binary variant_name)
# produce ASM listing. Note we also specify the .map as a byproduct so it gets cleaned
# because link_options doesn't have a "generated outputs" feature.
add_custom_command(
TARGET ${variant_name} POST_BUILD COMMAND ${CMAKE_OBJDUMP} -CSd ${variant_name} > ${variant_name}.asm
TARGET ${variant_name} POST_BUILD COMMAND ${CMAKE_OBJDUMP} --prefix ${CMAKE_SOURCE_DIR} -CSd ${variant_name} > ${variant_name}.asm
BYPRODUCTS ${variant_name}.asm ${variant_name}.map
)